You Are Here:

Community: Developer Discussion Boards

#1 Old Cool jsr172 problem: can't decode the received response package - 2006-08-08, 15:13

Join Date: Nov 2003
Posts: 19
jason_rency
Offline
Registered User
all,
I am trying to invoke a webservice from a j2me client.
I am using wtk 2.2 generate the stub code and using sun j2me webservice jar which implements jsr172.

I found that the j2me client couldn't decode the received response package properly:

Code:
javax.xml.rpc.JAXRPCException: java.rmi.MarshalException: (1)Missing end tag for Body or Envelope
	at com.sun.j2mews.xml.rpc.SOAPDecoder.decode(+243)
	at com.sun.j2mews.xml.rpc.OperationImpl.invoke(+90)
	at service.Calculator_Stub.add(+62)
the response package I got is:

Code:
<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
<env:Header/>
	<env:Body>
		<ns1:addResponse xmlns:ns1='http://server.reg.src/jaws' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
			<ns1:result>10</ns1:result>
		</ns1:addResponse>
	</env:Body>
</env:Envelope>
anything wrong with the package?

apparantly I can't trace further because I don't have the jsr172 RI source code.
Reply With Quote

#2 Old Re: jsr172 problem: can't decode the received response package - 2006-08-08, 23:19

Join Date: Apr 2003
Posts: 6,408
Location: USA, CA
hartti's Avatar
hartti
Offline
Nokia Expert
Just a thought. Have you tried with having both the begin and end tags for env:Header (instead of the combined tag)?

Hartti
Reply With Quote

#3 Old Re: jsr172 problem: can't decode the received response package - 2006-08-09, 11:02

Join Date: Nov 2003
Posts: 19
jason_rency
Offline
Registered User
that's a good thought and I would try?

very stupid question, how can I reformat the response message in the server side?

thanks a lot..
Reply With Quote

#4 Old Re: jsr172 problem: can't decode the received response package - 2006-08-09, 14:48

Join Date: Nov 2003
Posts: 19
jason_rency
Offline
Registered User
also, the response is missing <?xml version="1.0" encoding="UTF-8"?>

is this a matter?
Reply With Quote

#5 Old Re: jsr172 problem: can't decode the received response package - 2006-08-09, 15:02

Join Date: Dec 2005
Posts: 1,886
Location: Brazil
Send a message via MSN to juarezjunior Send a message via Skype™ to juarezjunior
juarezjunior's Avatar
juarezjunior
Offline
Forum Nokia Champion
Hi jason_rency,

Just a tip. Have you tried Carbide.j's JME Web Services Client Tool? Give it a try and compare the results...

BR,

Juarez Junior
Reply With Quote

#6 Old Re: jsr172 problem: can't decode the received response package - 2006-08-09, 16:48

Join Date: Nov 2003
Posts: 19
jason_rency
Offline
Registered User
hi Juarez,

I tried webservice client too from Carbide, and the generate stub tried to user Integer for int,
I then used the generated stub to test the web service got a 500 internal error and the response is:
Code:
<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
<env:Header/>
     <env:Body>
        <env:Fault> 
            <faultcode>env:Client</faultcode>
            <faultstring>javax.xml.rpc.JAXRPCException:   org.jboss.ws.binding.BindingException: javax.xml.bind.JAXBException: Failed to parse source:Requested element int_1 is not allowed in this position in thes
equence. The next element should be {http://server.reg.src/jaws}int_1</faultstring>
       </env:Fault>
    </env:Body>
</env:Envelope>
Reply With Quote

#7 Old Smile Re: jsr172 problem: can't decode the received response package - 2006-08-09, 17:47

Join Date: Nov 2003
Posts: 19
jason_rency
Offline
Registered User
where can I get jsr 172 source code?(if possible)
Reply With Quote

#8 Old Re: jsr172 problem: can't decode the received response package - 2006-08-09, 17:48

Join Date: Nov 2003
Posts: 19
jason_rency
Offline
Registered User
I mean, sun 's reference implementation
Reply With Quote

#9 Old Re: jsr172 problem: can't decode the received response package - 2006-08-09, 19:54

Join Date: Dec 2005
Posts: 1,886
Location: Brazil
Send a message via MSN to juarezjunior Send a message via Skype™ to juarezjunior
juarezjunior's Avatar
juarezjunior
Offline
Forum Nokia Champion
Hi jason_rency,

I am not a WebServices APIs and frameworks specialist but i had problems with .NET > Java integrations i performed before.

At that time i used Axis' wsdl2java tool and compared types with my code.

I also remember of issues with Float and Double types that are not available IN CLDC 1.0 (note that CLDC is the minimum for JSR-172).

However, i am not sure if your case is the same.

At last, note that JSR-172 RI is not publicly available AFAIK:

"The RI and TCK for JSR 172 are available to J2ME licensees through the Java Partner Engineering web site."
http://jcp.org/aboutJava/communitypr...172/index.html

BR,

Juarez Jr
Reply With Quote

#10 Old Re: jsr172 problem: can't decode the received response package - 2006-08-10, 03:01

Join Date: Dec 2005
Posts: 1,696
Location: Europe/Poland/Warsaw
peterblazejewicz
Offline
Super Contributor
hi Jason,

try to test that your .net end point is compatible with wsi basic implementation (used in jsr-179 implementation):
http://www.ws-i.org/Profiles/BasicPr...004-04-16.html
there should be some .net/java bridge tools for such compability tests,
or just write .net<>java bridge and use java implementation,
regards,
Peter
Reply With Quote

#11 Old Re: jsr172 problem: can't decode the received response package - 2006-08-10, 15:55

Join Date: Nov 2003
Posts: 19
jason_rency
Offline
Registered User
Quote:
Originally Posted by peterblazejewicz
hi Jason,

try to test that your .net end point is compatible with wsi basic implementation (used in jsr-179 implementation):
http://www.ws-i.org/Profiles/BasicPr...004-04-16.html
there should be some .net/java bridge tools for such compability tests,
or just write .net<>java bridge and use java implementation,
regards,
Peter
hi peter,

my web service end point is a jboss ejb3 web service (jsr 181), here is my wsdl file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<definitions name='CalculatorService' targetNamespace='http://server.reg.src/jaws' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://server.reg.src/jaws' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
 <types>
  <schema elementFormDefault='qualified' targetNamespace='http://server.reg.src/jaws' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://server.reg.src/jaws' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
   <complexType name='add'>
    <sequence>
     <element name='int_1' type='int'/>
     <element name='int_2' type='int'/>
    </sequence>
   </complexType>
   <complexType name='addResponse'>
    <sequence>
     <element name='result' type='int'/>
    </sequence>
   </complexType>
   <complexType name='subtract'>
    <sequence>
     <element name='int_1' type='int'/>
     <element name='int_2' type='int'/>
    </sequence>
   </complexType>
   <complexType name='subtractResponse'>
    <sequence>
     <element name='result' type='int'/>
    </sequence>
   </complexType>
   <element name='add' type='tns:add'/>
   <element name='addResponse' type='tns:addResponse'/>
   <element name='subtract' type='tns:subtract'/>
   <element name='subtractResponse' type='tns:subtractResponse'/>
  </schema>
 </types>
 <message name='Calculator_add'>
  <part element='tns:add' name='parameters'/>
 </message>
 <message name='Calculator_addResponse'>
  <part element='tns:addResponse' name='result'/>
 </message>
 <message name='Calculator_subtract'>
  <part element='tns:subtract' name='parameters'/>
 </message>
 <message name='Calculator_subtractResponse'>
  <part element='tns:subtractResponse' name='result'/>
 </message>
 <portType name='Calculator'>
  <operation name='add'>
   <input message='tns:Calculator_add'/>
   <output message='tns:Calculator_addResponse'/>
  </operation>
  <operation name='subtract'>
   <input message='tns:Calculator_subtract'/>
   <output message='tns:Calculator_subtractResponse'/>
  </operation>
 </portType>
 <binding name='CalculatorBinding' type='tns:Calculator'>
  <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
  <operation name='add'>
   <soap:operation soapAction=''/>
   <input>
    <soap:body use='literal'/>
   </input>
   <output>
    <soap:body use='literal'/>
   </output>
  </operation>
  <operation name='subtract'>
   <soap:operation soapAction=''/>
   <input>
    <soap:body use='literal'/>
   </input>
   <output>
    <soap:body use='literal'/>
   </output>
  </operation>
 </binding>
 <service name='CalculatorService'>
  <port binding='tns:CalculatorBinding' name='CalculatorPort'>
   <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
  </port>
 </service>
</definitions>
Reply With Quote

#12 Old Re: jsr172 problem: can't decode the received response package - 2006-08-10, 16:49

Join Date: Nov 2003
Posts: 19
jason_rency
Offline
Registered User
I looked at the jboss web site and it says jboss web serverice conforms to the WS-I basic profile, which eliminates the encoded use.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Using kxml package in J2ME!! PLEASE HELP ajayluthria Mobile Java General 3 2007-03-21 06:43
problem when create package asil810 Mobile Java Tools & SDKs 11 2003-08-08 11:47
CIMD Delivery Request Response delayed and with wrong package number wittmanna General Messaging 1 2003-07-10 08:34
Problem with Creating Package in Nokia Developer Suite 2.0 benjamin_lee Mobile Java Tools & SDKs 0 2003-06-24 14:00
problem at creating application package hari_t Mobile Java Tools & SDKs 0 2002-10-07 21:55

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia