You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Suneet Shah <su...@gmail.com> on 2009/11/20 12:54:42 UTC

Problem creating JAX-WS Client

Hello:

I am using the code below to consuming one of my service. In my 
environment this work fine and I have include the request below.
However, when I it to a customer the request seems to loose some of the 
name space information. The service that its consuming is based on the 
same wsdl. Any reason why th request would be different and how can I 
resolve this so that it produces the same request in both environments?

Thanks for your help

CLIENT CODE:

                                Service service = 
Service.create(QName.valueOf(connector.getServiceUrl()));                
              
                                service.addPort(new 
QName(connector.getServiceNameSpace(),
                                        connector.getServicePort()),
                                        SOAPBinding.SOAP11HTTP_BINDING,
                                        connector.getServiceUrl());   
                      
                                ConnectorService port = 
service.getPort(new QName(connector.getServiceNameSpace(),
                                        connector.getServicePort()),
                                        ConnectorService.class);

                                AddRequestType addReqType = new 
AddRequestType();
                                PSOIdentifierType idType = new 
PSOIdentifierType(lg.getId().getLogin(),null, "target");
                                addReqType.setPsoID(idType);
                                addReqType.setRequestID("R4589");
                                
addReqType.setTargetID(lg.getId().getManagedSysId());
                                 
                                ExtensibleUser extUser = new 
ExtensibleUser();                            
                                extUser.setName(user.getFirstName() + " 
" + user.getLastName());
                                extUser.getAttributes().add(new 
ExtensibleAttribute("cn",user.getFirstName() + " " + 
user.getLastName()));                                
                                
addReqType.getData().getAny().add(extUser);                    
                        
                                port.add(addReqType);


GOOD REQUEST:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns2:add xmlns:ns2="http://www.openiam.org/service/connector" 
xmlns:ns3="http://www.openiam.org/service/types">
         <reqType targetID="102" requestID="R4589">
            <ns2:psoID targetID="target" ID="test01.user05g"/>
            <ns2:data>
               <ns3:extensibleUser>
                  <ns3:name>Test User03</ns3:name>
                  <ns3:operation>0</ns3:operation>
                  <ns3:attributes>
                     <ns3:name>cn</ns3:name>
                     <ns3:value>Test User03</ns3:value>
                     <ns3:operation>1</ns3:operation>
                  </ns3:attributes>
               </ns3:extensibleUser>
            </ns2:data>
         </reqType>
      </ns2:add>
   </soap:Body>
</soap:Envelope>

FAILED REQUEST:

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <env:Body>
      <ns:add xmlns:ns="http://www.openiam.org/service/connector">
         <ns:reqType requestID="ID0" executionMode="synchronous" 
targetID="abcdef" returnData="identifier">
            <ns:psoID ID="abcdef" targetID="abcdef">
               <ns:containerID ID="abcdef" targetID="abcdef"/>
            </ns:psoID>
            <ns:containerID ID="abcdef" targetID="abcdef"/>
            <ns:data/>
            <ns:capabilityData mustUnderstand="true" 
capabilityURI="http://www.any.uri"/>
         </ns:reqType>
      </ns:add>
   </env:Body>
</env:Envelope>