Discussion Board

Results 1 to 12 of 12
  1. #1
    Registered User jason_rency's Avatar
    Join Date
    Nov 2003
    Posts
    19
    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.

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

    Hartti

  3. #3
    Registered User jason_rency's Avatar
    Join Date
    Nov 2003
    Posts
    19
    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..

  4. #4
    Registered User jason_rency's Avatar
    Join Date
    Nov 2003
    Posts
    19
    also, the response is missing <?xml version="1.0" encoding="UTF-8"?>

    is this a matter?

  5. #5
    Registered User juarezjunior's Avatar
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,883
    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

  6. #6
    Registered User jason_rency's Avatar
    Join Date
    Nov 2003
    Posts
    19
    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>

  7. #7
    Registered User jason_rency's Avatar
    Join Date
    Nov 2003
    Posts
    19
    where can I get jsr 172 source code?(if possible)

  8. #8
    Registered User jason_rency's Avatar
    Join Date
    Nov 2003
    Posts
    19
    I mean, sun 's reference implementation

  9. #9
    Registered User juarezjunior's Avatar
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,883
    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

  10. #10
    Super Contributor peterblazejewicz's Avatar
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,699
    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

  11. #11
    Registered User jason_rency's Avatar
    Join Date
    Nov 2003
    Posts
    19
    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>

  12. #12
    Registered User jason_rency's Avatar
    Join Date
    Nov 2003
    Posts
    19
    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.

Similar Threads

  1. Using kxml package in J2ME!! PLEASE HELP
    By ajayluthria in forum Mobile Java General
    Replies: 3
    Last Post: 2007-03-21, 05:43
  2. problem when create package
    By asil810 in forum Mobile Java Tools & SDKs
    Replies: 11
    Last Post: 2003-08-08, 10:47
  3. Replies: 1
    Last Post: 2003-07-10, 07:34
  4. Problem with Creating Package in Nokia Developer Suite 2.0
    By benjamin_lee in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2003-06-24, 13:00
  5. problem at creating application package
    By hari_t in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2002-10-07, 20:55

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved