You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by nhrraj <ra...@gmail.com> on 2012/07/20 01:38:44 UTC
getport returning http url instead of https
Hi All,
I am using CXF 2.3.11 to generate client stub classes for my app.
On runtime, I use the https url to call the service. But getport() is
returning a http url. Because of this the web service call is failing.
TestAppPortType port = new TestAppService(new
URL(gStrWSDL)).getTestAppPort();
gStrWSDL has my https wsdl url.
Can someone please help me?
thanks.
--
View this message in context: http://cxf.547215.n5.nabble.com/getport-returning-http-url-instead-of-https-tp5711336.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: getport returning http url instead of https
Posted by nhrraj <ra...@gmail.com>.
Thanks Glen for your help.
The problem is now fixed after using bindingprovider to change the endpoint.
The 404 not found error was because of the jvms not being in sync with the
cluster.
thanks.
--
View this message in context: http://cxf.547215.n5.nabble.com/getport-returning-http-url-instead-of-https-tp5711336p5711514.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: getport returning http url instead of https
Posted by Glen Mazza <gm...@talend.com>.
No, certainly the "?wsdl" suffix should not be part of the SOAP address,
you just use it when viewing from the browser.
CXF 2.2.x is unsupported, I'm not sure how to configure it or how you
can base security on top of it anyway (security on an obsolete version
of software is a bit of a contradiction). The configuration
instructions that you see in the online docs may very well not be
applicable for a version that old.
I can't think of an immediate solution, more detective work may be
needed. Possible ideas/options:
1.) I would check the WAS logs for any error messages pointing to the
problem, although from what I'm seeing below I don't think the app
server is even getting any message.
2.) As in my SSL tutorial I referenced earlier, does the truststore of
the JRE that the client is using (or the truststore that you've
specifically configured for you client) contain the public cert of the
WAS server? (That will be needed for SSL connections, but I think you
would have gotten another error message if that was the problem.)
3.) If you can do so without risking the transmission of sensitive data,
downgrade your web service provider temporarily to just HTTP and see if
you can get that working at least before moving to HTTPS. (will help
isolate whether the problem is HTTPS-related.)
4.) Create a Metro client using my SOAP client tutorial and see if it
works or doesn't (it will help show whether the problem is with CXF
client, your network, or WAS, or possibly give different errors better
pointing to the problem.)
5.) See if you can deploy your web service on Tomcat instead and see if
it works (can help show whether the problem is with the CXF web service
provider or WAS's internal configuration.)
6.) Deploy a Metro web service provider on WAS
(http://www.jroller.com/gmazza/entry/web_service_tutorial) and see if
that fixes the problem (another way of pinpointing whether the problem
is with CXF or WAS, and if you're not allowed to deploy anything more
recent than CXF 2.2.3, it may be a good time to use a different web
service stack instead.)
HTH,
Glen
On 07/20/2012 08:07 AM, nhrraj wrote:
> Yes, the wsdl is accessible.
>
> If I use, the url+"?wsdl" for creating the port, then I am getting the below
> error.
>
> javax.xml.ws.soap.SOAPFaultException: java.net.ConnectException: HTTP ( 404
> ) Not Found address : https://xx.yy.com/service/myservice?wsdl
>
> If I use only the url (without ?wsdl) for creating the port, then I am
> receiving the below error.
>
> java.net.ConnectException: HTTP ( 404 ) Not Found address :
> https://xx.yy.com/service/myservice
>
> Also, please note the client for this service runs in was 8.0 and uses cxf
> 2.3.11
>
> The server(that hosts myservice) runs on was 8.0 and uses cxf 2.2.3.
>
> Can this cause the problem?
>
> Please note that the service is up and wsdl is accessible. I am able to hit
> the service from .net client and soapui as well without any issues.
>
> thanks.
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/getport-returning-http-url-instead-of-https-tp5711336p5711355.html
> Sent from the cxf-user mailing list archive at Nabble.com.
--
Glen Mazza
Talend Community Coders
coders.talend.com
blog: www.jroller.com/gmazza
Re: getport returning http url instead of https
Posted by nhrraj <ra...@gmail.com>.
Yes, the wsdl is accessible.
If I use, the url+"?wsdl" for creating the port, then I am getting the below
error.
javax.xml.ws.soap.SOAPFaultException: java.net.ConnectException: HTTP ( 404
) Not Found address : https://xx.yy.com/service/myservice?wsdl
If I use only the url (without ?wsdl) for creating the port, then I am
receiving the below error.
java.net.ConnectException: HTTP ( 404 ) Not Found address :
https://xx.yy.com/service/myservice
Also, please note the client for this service runs in was 8.0 and uses cxf
2.3.11
The server(that hosts myservice) runs on was 8.0 and uses cxf 2.2.3.
Can this cause the problem?
Please note that the service is up and wsdl is accessible. I am able to hit
the service from .net client and soapui as well without any issues.
thanks.
--
View this message in context: http://cxf.547215.n5.nabble.com/getport-returning-http-url-instead-of-https-tp5711336p5711355.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: getport returning http url instead of https
Posted by Glen Mazza <gm...@talend.com>.
Can you find the wsdl from a browser at
https://xx.yy.com/service/myservice?wsdl? If no, that would mean your
service endpoint URL is not what you're supposing it to be.
Note #2 here:
http://www.jroller.com/gmazza/entry/web_service_tutorial#notes gives the
algorithm for how CXF calculates the endpoint address service-side. The
soap address you see in the WSDL is used only client-side, the web
service provider ignores it entirely and uses that algorithm instead.
Glen
On 07/20/2012 12:41 AM, nhrraj wrote:
> Thanks Glen.
>
> That fixes my https issue.
>
> But now I am getting 404 not found.
>
> java.net.ConnectException: HTTP ( 404 ) Not Found address :
> https://xx.yy.com/service/myservice
>
> Please let me know in case of any suggestions.
>
> thanks.
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/getport-returning-http-url-instead-of-https-tp5711336p5711339.html
> Sent from the cxf-user mailing list archive at Nabble.com.
--
Glen Mazza
Talend Community Coders
coders.talend.com
blog: www.jroller.com/gmazza
Re: getport returning http url instead of https
Posted by nhrraj <ra...@gmail.com>.
Thanks Glen.
That fixes my https issue.
But now I am getting 404 not found.
java.net.ConnectException: HTTP ( 404 ) Not Found address :
https://xx.yy.com/service/myservice
Please let me know in case of any suggestions.
thanks.
--
View this message in context: http://cxf.547215.n5.nabble.com/getport-returning-http-url-instead-of-https-tp5711336p5711339.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: getport returning http url instead of https
Posted by Glen Mazza <gm...@talend.com>.
For the client-side (not the service-side), the WSDL that you use to
generate your JAX-WS objects needs to have the correct https:// URL in
the wsdl:service section. You'll see that URL hardcoded in the service
object generated by the wsdl2java tool, and then getPort() will give you
that correct URL.
Articles #1 and #11 may be of help for you:
http://www.jroller.com/gmazza/entry/blog_article_index, and if you can
please update to a recent version of CXF.
Glen
On 07/19/2012 07:38 PM, nhrraj wrote:
> Hi All,
>
> I am using CXF 2.3.11 to generate client stub classes for my app.
>
> On runtime, I use the https url to call the service. But getport() is
> returning a http url. Because of this the web service call is failing.
>
> TestAppPortType port = new TestAppService(new
> URL(gStrWSDL)).getTestAppPort();
>
> gStrWSDL has my https wsdl url.
>
> Can someone please help me?
>
> thanks.
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/getport-returning-http-url-instead-of-https-tp5711336.html
> Sent from the cxf-user mailing list archive at Nabble.com.
--
Glen Mazza
Talend Community Coders
coders.talend.com
blog: www.jroller.com/gmazza