| Reply | « Previous Thread | Next Thread » |
|
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) 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> apparantly I can't trace further because I don't have the jsr172 RI source code. |
| jason_rency |
| View Public Profile |
| Find all posts by jason_rency |
|
Just a thought. Have you tried with having both the begin and end tags for env:Header (instead of the combined tag)?
Hartti |
|
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.. |
| jason_rency |
| View Public Profile |
| Find all posts by jason_rency |
|
also, the response is missing <?xml version="1.0" encoding="UTF-8"?>
is this a matter? |
| jason_rency |
| View Public Profile |
| Find all posts by jason_rency |
|
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 |
|
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>
|
| jason_rency |
| View Public Profile |
| Find all posts by jason_rency |
|
where can I get jsr 172 source code?(if possible)
|
| jason_rency |
| View Public Profile |
| Find all posts by jason_rency |
|
I mean, sun 's reference implementation
|
| jason_rency |
| View Public Profile |
| Find all posts by jason_rency |
|
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 |
|
Join Date: Dec 2005
Posts: 1,696
Location: Europe/Poland/Warsaw
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 |
| peterblazejewicz |
| View Public Profile |
| Find all posts by peterblazejewicz |
|
Quote:
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>
|
| jason_rency |
| View Public Profile |
| Find all posts by jason_rency |
|
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.
|
| jason_rency |
| View Public Profile |
| Find all posts by jason_rency |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| 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 |