users@jax-rpc.java.net

Re: JAX_RPC_ISSUE

From: badal garg <badalgarg_at_gmail.com>
Date: Wed, 29 Dec 2004 19:58:24 -0500

Hi Anne,

Here is all the information:

1. Command Line:

Command I am using to generate the code from WSDL:

C:\jwsdp-1.5\jaxrpc\bin\wscompile.bat -classpath . -keep -s
C:\Portal\peoplesoft\jaxrpc_proto_handler\src -gen:client
C:\Portal\peoplesoft\jaxrpc_proto_handler\wsdl\conf.xml

2. Conf.xml (attached)


3. WSDL : DETP.wsdl (attached)


4. Client Code: PSClient.java (attached)


5. Client Handler: PSClientHandler.java (attached)


6. Classpath :

set classpath=.;C:\jwsdp-1.5\jaxrpc\lib\jaxrpc-api.jar;C:\jwsdp-1.5\jaxrpc\lib\jaxrpc-impl.jar;C:\jwsdp-1.5\jaxrpc\lib\jaxrpc-spi.jar;C:\jwsdp-1.5\jwsdp-shared\lib\activation.jar;C:\jwsdp-1.5\jwsdp-shared\lib\commons-beanutils.jar;C:\jwsdp-1.5\jwsdp-shared\lib\commons-collections.jar;C:\jwsdp-1.5\jwsdp-shared\lib\commons-digester.jar;C:\jwsdp-1.5\jwsdp-shared\lib\commons-logging.jar;C:\jwsdp-1.5\jwsdp-shared\lib\jaas.jar;C:\jwsdp-1.5\jwsdp-shared\lib\jax-qname.jar;C:\jwsdp-1.5\jwsdp-shared\lib\jta-spec1_0_1.jar;C:\jwsdp-1.5\jwsdp-shared\lib\mail.jar;C:\jwsdp-1.5\jwsdp-shared\lib\namespace.jar;C:\jwsdp-1.5\jwsdp-shared\lib\relaxngDatatype.jar;C:\jwsdp-1.5\jwsdp-shared\lib\xsdlib.jar;C:\jwsdp-1.5\saaj\lib\saaj-impl.jar;C:\jwsdp-1.5\saaj\lib\saaj-api.jar;C:\jwsdp-1.5\jaxp\lib\endorsed\xalan.jar;C:\jwsdp-1.5\jaxp\lib\endorsed\xercesImpl.jar;C:\jwsdp-1.5\jaxp\lib\endorsed\dom.jar;%classpath%




7. Message received at server:

Message-ID: <5599872.1104363256888.JavaMail.psofthr_at_sunpsdw1>
Date: Wed, 29 Dec 2004 18:34:16 -0500 (EST)
Mime-Version: 1.0
Content-Type: multipart/related;
boundary="----=_Part_154_2140202.1104363256884"
Content-ID: PeopleSoft-Integration-Broker-Internal-Mime-Message

------=_Part_154_2140202.1104363256884
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
Content-ID: IBInfo

<?xml version="1.0"?><IBInfo><MessageName><![CDATA[SOAPTOCI]]></MessageName><From><RequestingNode><![CDATA[PSFT_HR]]></RequestingNode></From><ContentSections><ContentSection><ID>ContentSection0</ID><NonRepudiation>N</NonRepudiation><Headers><Content-Type><![CDATA[text/xml;
charset=utf-8]]></Content-Type><User-Agent><![CDATA[Java/1.4.2_04]]></User-Agent><Host><![CDATA[sunpsdw1.cvs.com:8085]]></Host><Accept><![CDATA[text/html,
image/gif, image/jpeg, *; q=.2, */*;
q=.2]]></Accept><Connection><![CDATA[keep-alive]]></Connection></Headers></ContentSection></ContentSections></IBInfo>
------=_Part_154_2140202.1104363256884
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
Content-ID: ContentSection0

<?xml version="1.0"?><env:Envelope
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns0="http://psfttemp.org"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Header><ns0:Security_Request><ns0:Username>PS2</ns0:Username><ns0:Password>PS2</ns0:Password></ns0:Security_Request></env:Header><env:Body><ns0:Get__CompIntfc__DEPT><ns0:SETID>CVSUS</ns0:SETID><ns0:DEPTID>99431</ns0:DEPTID></ns0:Get__CompIntfc__DEPT></env:Body></env:Envelope>
------=_Part_154_2140202.1104363256884--





8. Error at client side:

C:\Portal\peoplesoft\jaxrpc_proto_handler>java PSClient
1: null
2: null
Start main()
befor GET
In handleRequest
ClientHandler1: loggerElement
after
After loginHandlercom.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl_at_10a2d64
Dec 29, 2004 6:44:14 PM com.sun.xml.messaging.saaj.soap.MessageImpl identifyCont
entType
SEVERE: SAAJ0537: Invalid Content-Type. Could be an error message instead of a S
OAP message
Dec 29, 2004 6:44:14 PM com.sun.xml.messaging.saaj.soap.MessageImpl <init>
SEVERE: SAAJ0535: Unable to internalize message
java.rmi.RemoteException: HTTP transport error: com.sun.xml.messaging.saaj.SOAPE
xceptionImpl: Unable to internalize message; nested exception is:
       HTTP transport error: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unab
le to internalize message
       at com.cvs.DEPTSoap_Stub.get__CompIntfc__DEPT(DEPTSoap_Stub.java:93)
       at PSClient.main(PSClient.java:43)
Caused by: HTTP transport error: com.sun.xml.messaging.saaj.SOAPExceptionImpl: U
nable to internalize message
       at com.sun.xml.rpc.client.http.HttpClientTransport.invoke(HttpClientTran
sport.java:140)
       at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:92)

       at com.cvs.DEPTSoap_Stub.get__CompIntfc__DEPT(DEPTSoap_Stub.java:70)
       ... 1 more





9. If I send the message removing ns0 from the following, it works:

<?xml version="1.0"?><env:Envelope
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns0="http://psfttemp.org"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Header><ns0:Security_Request><ns0:Username>PS2</ns0:Username><ns0:Password>PS2</ns0:Password></ns0:Security_Request></env:Header><env:Body><ns0:Get__CompIntfc__DEPT><ns0:SETID>CVSUS</ns0:SETID><ns0:DEPTID>99431</ns0:DEPTID></ns0:Get__CompIntfc__DEPT></env:Body></env:Envelope>


Please let me know if I am doing something wrong ? I am trying this
for last 3 day. As per the documentation on java.net by Arun Gupta, it
should work.

I really appreciate your help.

Thanks,
Badal Garg


On Wed, 29 Dec 2004 15:50:38 -0500, Anne Thomas Manes <atmanes_at_gmail.com> wrote:
> Can you provide us with the WSDL file?
>
> A few things I notice:
> #3 uses literal encoding, but #4 uses SOAP encoding.
> #3 namespace qualifies all elements, which implies that it uses
> document style. I assume that #4 uses RPC style because it uses SOAP
> encoding. BUT, #4 does not namespace qualify the child element of the
> <env:Body> element, which is illegal. I don't believe that you can
> produce a SOAP message using JAX-RPC in which the child element of the
> <env:Body> element is not namespace qualified.
>
> If you cannot modify the service so that it accepts a namespace
> qualified element, then I suggest you manually construct the SOAP
> message using SAAJ. Alternatively, you can implement a handler that
> transforms the SOAP message into the specific format you require.
>
> It should not make any difference whether you use the "env" or
> "SOAP-ENV" prefix name.
>
> Anne
>
>
> On Tue, 28 Dec 2004 13:28:41 -0500, badal garg <badalgarg_at_gmail.com> wrote:
> > Hi all,
> >
> > I am working on Web Services. I am using JAX-RPC for Client code
> > generation from WSDL.
> >
> > Here is the information:
> >
> > 1. Command for code generation:
> >
> > wscompile.bat -keep -s C:\Portal\src -gen:client C:\Portal\wsdl\conf.xml
> >
> > 2. Client code used:
> > public class PSClient {
> >
> > public static void main(String[] args) {
> > try
> > {
> >
> > DEPTCIService_Impl ws = new DEPTCIService_Impl();
> > DEPTSoap deptSOAP = ws.getDEPTSoap();
> >
> > DEPT_TBL[] deptTbl = deptSOAP.get__CompIntfc__DEPT("ABCD", "99431");
> >
> > System.out.println("Got the results from: " + deptTbl);
> >
> > } catch (Exception ex) {
> > ex.printStackTrace();
> > }
> > }
> > }
> >
> > 3. The message generated:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
> > xmlns:ns0="http://psfttemp.org">
> > <env:Body>
> > <ns0:Get__CompIntfc__DEPT>
> > <ns0:SETID>CVSUS</ns0:SETID>
> > <ns0:DEPTID>99431</ns0:DEPTID>
> > </ns0:Get__CompIntfc__DEPT>
> > </env:Body>
> > </env:Envelope>
> >
> > 4. SOAP message required:
> >
> > <?xml version="1.0"?>
> > <SOAP-ENV:Envelope
> > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
> > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> > <SOAP-ENV:Body>
> > <GET__CompIntfc__DEPT>
> > <SETID>abcid</SETID>
> > <DEPTID>99430</DEPTID>
> > </GET__CompIntfc__DEPT>
> > </SOAP-ENV:Body>
> > </SOAP-ENV:Envelope>
> >
> > Please let me know if you have worked with JAX-PRC, how I can get the
> > required SOAP request (as in 4) from the JAX-RPC generated code?
> >
> > Please help.
> >
> > Thanks,
> > BG
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
> > For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
> For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net