While creating proxy service based on wsdl, by default its taking soap 1.1, so how can we convert or make it to use it as soap 1.2 - osb

When i try to create an Proxy service in OSB based on WSDL, by default its considering soap version as 1.1 but my requirement is to use soap version 1.2, so can anyone help me on how to change the soap version to 1.2.
WSDl file doesn't contain any soap version details neither at binding level nor at port level.
Thanks,
Anil.

issue resolved after adding extra service in the wsdl file, like below.
<wsdl:service name="Server">
<!-- SOAP1.1 Service -->
<wsdl:port name="ServerSoap" binding="tns:ServerSoap">
<soap:address location="http://localhost:8080/Server" />
</wsdl:port>
<!-- SOAP1.2 Service -->
<wsdl:port name="ServerSoap12" binding="tns:ServerSoap12">
<soap12:address location="http://localhost:8080/Server" />
</wsdl:port>
</wsdl:service>
Thanks,
Anil.

You need to change a little your wsdl file and start using your soap 1.2 namespace. After that change, when you try create Proxy service from updated wsdl, you should achieve your goal.
Soap namespaces:
soap 1.1: xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
soap 1.2: xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
You can use it proper in your wsdl file.
If you can provide your wsdl i can help you change it correctly, if you still gonna be struggling with it.

Related

Why two requests generated while creating new soapui project

When we create a new soapui project why 2 requests generated instead of 1. For eg in the attached snapshot one is "StockQuoteSoap" and other is "StockQuoteSoap12". while xml request is same under both of these.
So what is the purpose of two same requests.
Thanks
One is for SOAP version 1.1, the other is for SOAP version 1.2. This is generated via the WSDL from your server.

In OSB can you change the proxy service or business service WSDL using a Customisation File?

In OSB can you change the proxy service or business service WSDL using a Customisation File?
if so how?
I think I worked it out myself:
<cus:externalReferenceMap>
<xt:oldRef>
<xt:type>WSDL</xt:type>
<xt:path>ProjectName/wsdl/MyWsdlNameOld</xt:path>
</xt:oldRef>
<xt:newRef>
<xt:type>WSDL</xt:type>
<xt:path>ProjectName/wsdl/MyWsdlNameNew</xt:path>
</xt:newRef>
</cus:externalReferenceMap>

How to access a remote web service by Camel CXF endpoint?

I was looking up online how to create a Camel's CXF producer (i.e. create a CXF endpoint that would produce a request to some local/remote web service). Generally, all the examples I could find would list the following steps:
First define the cxfEndpoint attributes:
<cxf:cxfEndpoint
id="orderEndpoint"
address="http://localhost:9000/order/"
serviceClass="camelinaction.order.OrderEndpoint"/>
Then send the request to that endpoint:
...to("cxf:bean:orderEndpoint");
Hmmm. I don't understand the concept. If this is a remote web service, all I usually have is the URL of the WSDL. I can get from it the address of the service... but I don't know what the serviceClass is and I don't have it on my classpath.
So how do I define that cxfEndpoint in case I only have the URL of the WSDL?
Or is there another type of endpoint I should use in that case?
I would suggest looking into WSDL first for cxf. Below are two links that I think should help you out quite a lot and has helped me in the past as well.
http://code.notsoclever.cc/camel-cxf-component-wsdl-first-example/
https://access.redhat.com/documentation/en-US/Fuse_ESB_Enterprise/7.0/html-single/Web_Services_and_Routing_with_Camel_CXF/index.html#ImplWs-WsdlFirst
On the Red Hat site you will need to start at chapter 3.
Hope this helps.

Can you tell what kind of database is the WSDL using?

Can you tell what kind of database is the WSDL using? The reason for asking is the 3rd party only give me a url and and didnt tell me anything about the database. I requested them to give me the document to explain a bit but they never did.
I am new in this area and after some research, but i cannot sure what database (oracle?sql?xml?)
<?xml version='1.0' encoding='UTF-8'?>
<wsdl:definitions name="AccountService" targetNamespace="http:// local host/web/" xmlns:ns1="http://client.local host/web//" xmlns:ns2="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://local host/web/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://local host/web/" xmlns:tns="local host/web/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="ArrayOfAccount">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="Account" nillable="true" type="tns:Account"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Account">
<xsd:sequence>
<xsd:element minOccurs="0" name="currentbalance" nillable="true" type="xsd:decimal"/>
</xsd:sequence>
</xsd:complexType>
The second question is, can i use .asp call out the element from the database directly?
The last question is, WSDL is just a set of policy (rules) telling the server to generate the result?
No, it is not possible to determine the internal implementation of a web service solely from it's WSDL.
For your questions:
You can't tell what sort of database, or even anything about the back-end of a Web service from the WSDL. It is specifically a descriptive document that shows what types of methods are available. It could be a Java based Web service, .Net, or whatever, and point to what ever database the Web service developer decided to use. The point of having a service model is that a client doesn't really need to know anything about the inner workings of a service it uses, just what functions you can call, and what sort of data it accepts, which is what the WSDL provides.
If you are hosting the Web service, then you would have the database and directions to set up the connection string. In that case, your ASP application "could" connect to the database, but it shouldn't, since it would defeat the purpose of having the service in the first place. It's better to update the service to include whatever functions you need. From your request though, it sounds like you have no control over the Web service, so you won't have any connection directly to the database. If the database were on the same network as your service, and there were no firewall policies blocking database connections, you could theoretically connect to the database the service uses. But, again, that would defeat the purpose of having the service.
WSDL is just an XML file that describes what the service can do. It doesn't actually do any work. The work is handled when you make an Http request with something like WebClient or HttpClient to a URL passing in the needed information. So, the WSDL may show in XML:
Method URL:
http://someURL/UpdateAccounts
Accepts Parameters:
Account
Then in your service you would code to post a request to
http://someURL/UpdateAccounts
passing in Account converted to XML.
A WSDL is a document describing a webservice, listing all the web methods, and their paramaters. It helps you build a client that can consume the webservice. It describes how you can communicate with the webservice. The webservice itself could be implemented anyway the creator wants, with or without a DB. They aren't related at all.
WSDL describes only the interface, like the function definition. Not the internals about the service. So no, you can not tell.

Eclipse fails to create Web Service client using AXIS2 and CXF

After a few days trying to develop a WS client from a provided WSDL, I discover I was all this time using axis, and not axis2...
Well, what I'm doing is right clicking the wsdl > New > Other > Web Service Client.
In the wizard window, 'Web service runtime' was all this time set to 'Apache Axis', and I didn't see that. Clicking on it I'm able to choose 'Apache Axis2' and 'Apache CXF 2.x', but both fails, while 'Apache Axis' "works": client is created, but doesn't add header username and password to XML request.
Here's the error I get when trying to use CXF:
Unable to add the follwing facets to project SIAPP_WS_FORNECEDOR_CFX_01: CXF 2.x Web Services.
org.eclipse.wst.common.project.facet.core.FacetedProjectFrameworkException: Failed while installing CXF 2.x Web Services 1.0.
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.callDelegate(FacetedProject.java:1507)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.modifyInternal(FacetedProject.java:441)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.mergeChangesInternal(FacetedProject.java:1181)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.access$2(FacetedProject.java:1117)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject$1.run(FacetedProject.java:324)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.modify(FacetedProject.java:339)
at org.eclipse.jst.ws.internal.consumption.ui.common.FacetOperationDelegate$1.run(FacetOperationDelegate.java:62)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: org.eclipse.core.runtime.CoreException: CXF Runtime location not set. Please set location in Preferences > Web Services > CXf 2.x Preferences
at org.eclipse.jst.ws.internal.cxf.facet.CXFFacetInstallDelegate.execute(CXFFacetInstallDelegate.java:50)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.callDelegate(FacetedProject.java:1477)
... 8 more
For CXF, you would need to go to Preference -> Web Service -> CXF 2.x Preferences and add a CXF runtime (point to an CXF installation). That should allow it to find the wsdl2java tool (and such) that would be needed for CXF.

Resources