cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colin Smith (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CXF-414) Setting ENDPOINT_ADDRESS_PROPERTY property on client proxy has no effect
Date Tue, 18 Nov 2008 10:35:44 GMT

    [ https://issues.apache.org/jira/browse/CXF-414?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12648570#action_12648570
] 

Colin Smith commented on CXF-414:
---------------------------------

I don't believe this issue is fixed. 

I am using CXF 2.1.3 to access the SalesForce.com enterprise web service, which, after logon,
requires the client to update the endpoint address with the serverUrl returned in the logon
result.

To reproduce this problem you will need to sign up for a developer account with salesforce.com
and download the wsdl by clicking Setup -> Develop -> API -> Download Enterprise
WSDL. To log in successfully you must append your security token (which is emailed to you)
to your password.

The stack trace below is produced by the following code:

            LoginResult result = sforceService.getSoap().login(getUsername(), getPassword());
            String serverUrl = result.getServerUrl();
            Soap service = sforceService.getPort(Soap.class);
            Map<String, Object> requestContext = ((BindingProvider)service).getRequestContext();
            requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serverUrl);
            DescribeGlobalResult describeGlobalResult = sforceService.getSoap().describeGlobal();
            List<String> types = describeGlobalResult.getTypes();

Testcase: testPing(com.cmc.crmbridge.services.salesforce.TestSalesForceWebServiceClient):
       Caused an ERROR
javax.xml.ws.soap.SOAPFaultException: UNKNOWN_EXCEPTION: Destination URL not reset. The URL
returned from login must be set in the SforceService
com.cmc.crmbridge.services.CRMServiceException: javax.xml.ws.soap.SOAPFaultException: UNKNOWN_EXCEPTION:
Destination URL not reset. The URL returned from login must be set in the SforceService
        at com.cmc.crmbridge.services.salesforce.SalesForceWebServiceClient.logon(SalesForceWebServiceClient.java:194)
        at com.cmc.crmbridge.services.salesforce.SalesForceWebServiceClient.ping(SalesForceWebServiceClient.java:300)
        at com.cmc.crmbridge.services.salesforce.TestSalesForceWebServiceClient.testPing(TestSalesForceWebServiceClient.java:41)
Caused by: javax.xml.ws.soap.SOAPFaultException: UNKNOWN_EXCEPTION: Destination URL not reset.
The URL returned from login must be set in the SforceService
        at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:145)
        at $Proxy42.describeGlobal(Unknown Source)

I also tried using the Dynamic client, without luck:
1) putting the serverUrl in the Map returned by Client.getRequestContext()
2) passing the serverUrl to Client.getEndpoint().getEndpointInfo().setAddress(serverUrl);


> Setting ENDPOINT_ADDRESS_PROPERTY property on client proxy has no effect
> ------------------------------------------------------------------------
>
>                 Key: CXF-414
>                 URL: https://issues.apache.org/jira/browse/CXF-414
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>            Reporter: Jarek Gawor
>            Assignee: Daniel Kulp
>             Fix For: 2.0-RC
>
>
> I'm doing the following:
> Greeter g = foo.getPort(Greeter.class);
> (javax.xml.ws.BindingProvider)g).getRequestContext().put(javax.xml.ws.BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://localhost:8080/jaxws-war-2.0-SNAPSHOT/hello");
> g.greetMe("foo");
> when the ENDPOINT_ADDRESS_PROPERTY is set or not I get the following exception:
> org.apache.cxf.interceptor.Fault
>         at org.apache.cxf.endpoint.ClientImpl.getConduit(ClientImpl.java:299)
>         at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:138)
>         at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
>         at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:12
> 4)
>         at $Proxy54.greetMe(Unknown Source)
>         at org.apache.hello_world_soap_http.GreeterImpl.greetMe(GreeterImpl.java
> ....
> Caused by: java.net.MalformedURLException
>         at java.net.URL.<init>(URL.java:601)
>         at java.net.URL.<init>(URL.java:464)
>         at java.net.URL.<init>(URL.java:413)
>         at org.apache.cxf.transport.http.HTTPConduit.<init>(HTTPConduit.java:138
> )
>         at org.apache.cxf.transport.http.HTTPConduit.<init>(HTTPConduit.java:111
> )
>         at org.apache.cxf.transport.http.HTTPConduit.<init>(HTTPConduit.java:97)
>         at org.apache.cxf.transport.http.HTTPTransportFactory.getConduit(HTTPTra
> nsportFactory.java:115)
>         at org.apache.cxf.transport.http.HTTPTransportFactory.getConduit(HTTPTra
> nsportFactory.java:111)
>         at org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTrans
> portFactory.java:152)
>         at org.apache.cxf.endpoint.ClientImpl.getConduit(ClientImpl.java:295)
>         ... 41 more
> The MalformedURLException s raised in HTTPConduit because endpointInfo.getAddress() returns
null or empty.
> To fix this I had to add the following to JaxWsClientProxy:
>         ...
>         ContextPropertiesMapping.mapRequestfromJaxws2Cxf(reqContext);
>         String address = (String)reqContext.get(org.apache.cxf.message.Message.ENDPOINT_ADDRESS);
>         if (address != null) {
>             endpoint.getEndpointInfo().setAddress(address);
>         }
>  
>         ..
>         context.put(Client.REQUEST_CONTEXT, reqContext);
> Also, I think the problem is when the Service instance is created from full WSDL the
EndpointInfo is not completely filled out with the service address information as specified
in WSDL. But that's a separate issue from above.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message