I have a WCF service. I built from an xsd file from another department. All it generated was classes, which I inturn modified to match our "standards". I need to see if the wsdl for that function matches the xsd, well actually the wsdl for one of the inputs, matches what they gave us.
http://localhost:26535/EDeliveryOrderSvc.svc?wsdl
shows the wsdl for the entire service. the section for my function:
<wsdl:operation name="CreateOrUpdateOSSOrdersFromEntityInput">
<soap:operation soapAction="http://[redacted]/EDeliveryOrderSvc/CreateOrUpdateOSSOrdersFromEntityInput" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
doesn't tell me anything about the input parameters. Am I missing something simple?
You should see a line in the wsdl that says:
http://localhost:26535/EDeliveryOrderSvc.svc?xsd=xsd2
or some such, go there to see the schema info.
Related
I want to use WSO2EI 6.4.0 as a proxy for SOAP and REST services authentication platform (later maybe authorization).
I found solution in documentation of wso2 (https://docs.wso2.com/display/EI640/Applying+Security+to+an+API), but unfortunately it is not working.
Adding "handler" element into service definition
<handlers>
<handler class="org.wso2.carbon.integrator.core.handler.RESTBasicAuthHandler"/>
</handlers>
results into exception in design time (eclipse):
Invalid mediator <handler class="org.wso2.carbon.integrator.core.handler.RESTBasicAuthHandler"/> 1d6bbce1-08e3-42d5-b550-6a4e224b0028.xml /.tmp/.org.wso2.developerstudio.eclipse.esb line 15 org.wso2.developerstudio.eclipse.gmf.esb.diagram.synapseerror
Ignoring and deploying such API, makes the API stop working.
Could anyone help please?
The way you are trying to add the Basic authentication for API in WSO2EI 6.4.0 is correct. Developer studio will give a warning as you mentioned, but it should not be an issue. Developer studio will allow setting the handler regardless of the warning and you should be able to create a Composite Application which includes the API and deploy it to ESB. Following is a sample API with the RESTBasicAuthHandler.
<?xml version="1.0" encoding="UTF-8"?>
<api context="/testapi" name="testapi" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="POST" protocol="https" url-mapping="/*">
<inSequence>
<send>
<endpoint name="testapi_EP">
<http uri-template="http://localhost:8080/testapi"/>
</endpoint>
</send>
</inSequence>
<outSequence/>
<faultSequence/>
</resource>
<handlers>
<handler class="org.wso2.carbon.integrator.core.handler.RESTBasicAuthHandler"/>
</handlers>
</api>
I'm adding a service reference using a WSDL and XSDs on a local drive. I've done this many times in the past and the client class generated derives from System.ServiceModel.ClientBase. For some reason, the only client class I get is derived from System.ServiceModel.DuplexClientBase.
I've tried unchecking "Allow generation of asynchronous operations" but I still only get one client class derived from DuplexClientBase.
How can a get a "normal" client derived from ClientBase?
I just tried one of the other WSDLs again and it generated the "normal" non-duplex client. Is there something specified in the WSDL that forces a duplex client only?
The WSDL defined one out of several operations with an output element only. When I removed this operation and re-generated the proxy, it created a non-duplex client as expected. Luckily, we do not need the "blahNbrChg" operation.
<wsdl:portType name="BlahPortType">
<wsdl:operation name="blahNbrChg">
<wsdl:output message="tns:blahNbrChgSoapOut"/>
<wsdl:fault name="fault" message="tns:soapFault"/>
</wsdl:operation>
<wsdl:operation name="xxxControl">
<wsdl:input message="tns:xxxControlSoapIn"/>
<wsdl:output message="tns:xxxControlSoapOut"/>
<wsdl:fault name="fault" message="tns:soapFault"/>
</wsdl:operation>
I have a wsdl (that works) and I've generated boilerplate code from it but wish to use my original wsdl not the auto generated one but on changing useOriginalwsdl to true I get errors. There is absolutely no documentation in the Axis website regarding this property so I have followed the steps here:
useOriginalwsdl=true is not working in axis2
specifically:
My services.xml has the same name as the wsdl service name
I have called my wsdl service.wsdl and put it in the META-INF folder (I also tried it with the service name)
But I get the error Unable to generate WSDL 1.1 for this service
Below is my folder structure:
.\com
.\lib
.\META-INF
services.xml
service.wsdl
My services.xml is:
<?xml version="1.0" encoding="UTF-8"?><!-- This file was auto-generated from WSDL -->
<!-- by the Apache Axis2 version: 1.6.2 Built on : Apr 17, 2012 (05:33:49 IST) -->
<serviceGroup>
<service name="MyService">
<messageReceivers>
<messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="com.neil.systems.ServiceMessageReceiverInOut"/>
</messageReceivers>
<parameter name="ServiceClass">com.neil.webservice.MyService</parameter>
<parameter name="useOriginalwsdl">true</parameter>
<parameter name="modifyUserWSDLPortAddress">false</parameter>
<operation name="Provision" mep="http://www.w3.org/ns/wsdl/in-out" namespace="http://xmlns.neil.com/systems">
<actionMapping>http://xmlns.neil.com/systems/Provision</actionMapping>
<outputActionMapping>http://xmlns.neil.com/systems/ProvisionResponse</outputActionMapping>
</operation>
</service>
</serviceGroup>
My service.wsdl, the relevant part is:
<wsdl:service name="MyService">
Note, I changed a couple of things in the services.xml to reduce the size so any obvious errors is just down to my cutting.
We have CXF based SOAP web services and we are hitting these services from SOAP UI with no problem. With one of these services, I setup a ProxyService on barebone WSO2 ESB 4.6.0. The proxy service seems to be working with the "Try It" option from the admin console. When I try to access it from SOAPUI, the WSO2 ESB starts complaining that
"The endpoint reference (EPR) for the Operation not found is /services/HelloWorldProxyService and the WSA Action = . If this EPR was previously reachable, please contact the server administrator."
Now, when I change the endpoint URL in SOAPUI as http:// hostname:8280/services/service-name.port-name/operation-name things start to work.
Does anyone know how to fix this issue? Are there configuration options on the WSO2 ESB which will let us use traditional SOAPUI with WSO2 ESB?
You can point the proxy service url(you can view this, via service dashboard of the particular proxy) in soapui and for the "action", in the insequence of the proxy define a property call;
. header name="Action" value="soap action"
Here is the guide on vailable properties
http://wso2.org/project/esb/java/3.0.0/docs/properties_guide.html
I have the same problem if I put operation1 at the end of WS URI (http://somedomain.com/WebServiceProxyName/operation1), but post a SOAP message body with constructs for another operation(operation2,3,4,5...) it works!!!
Sample
POST http://somedomain.com/..../operation1 HTTP/1.1
....
....
<soap:Envelope ...>
<soap:Header/>
<soap:Body>
<ws:operation2>
</ws:operation2>
</soap:Body>
</soap:Envelope>
Try to change the (original) WSDL and put the soapAction there:
You can define it as an attribute of the http://schemas.xmlsoap.org/wsdl/soap/:operation element in the binding section, e.g.
<wsdl:binding name="healthcheck-1.0.0SOAP" type="tns:HealthCheck100PortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="doHealthCheck">
<soap:operation soapAction="http://www.xyz.ch/healthcheck-1.0.0/doHealthCheck"/>
I am trying to add a web service reference to my C# application in Visual Studio. The web service is hosted on Sun's GlassFish server. Unfortunately Visual Studio produces the following warning when I try to add the service reference:
Custom tool warning: The following Policy Assertions were not Imported:
XPath://wsdl:definitions/wsdl:binding[#name='SecurityWebServicePortBinding']/wsdl:operation[#name='RegisterUser']
Assertions:
<wsat:ATAlwaysCapability xmlns:wsat='http://schemas.xmlsoap.org/ws/2004/10/wsat'>..</wsat:ATAlwaysCapability>
Apparently it cannot understand policy assertions in the WSDL published by the GlassFish server. Here's an excerpt from the WSDL:
<?xml version='1.0' encoding='UTF-8'?>
<definitions
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://test/securityservice.wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://test/securityservice.wsdl"
name="SecurityService">
<wsp:Policy xmlns:wsat="http://schemas.xmlsoap.org/ws/2004/10/wsat" wsu:Id="SecurityWebServicePortBinding_AuthenticateUser_WSAT_Policy">
<wsat:ATAlwaysCapability />
<wsat:ATAssertion xmlns:ns1="http://schemas.xmlsoap.org/ws/2002/12/policy" wsp:Optional="true" ns1:Optional="true" />
</wsp:Policy>
<wsp:Policy xmlns:wsat="http://schemas.xmlsoap.org/ws/2004/10/wsat" wsu:Id="SecurityWebServicePortBinding_RegisterUser_WSAT_Policy">
<wsat:ATAlwaysCapability />
<wsat:ATAssertion xmlns:ns2="http://schemas.xmlsoap.org/ws/2002/12/policy" wsp:Optional="true" ns2:Optional="true" />
</wsp:Policy>
...
<binding name="SecurityWebServicePortBinding" type="tns:SecurityWebService">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<operation name="RegisterUser">
<wsp:PolicyReference URI="#SecurityWebServicePortBinding_RegisterUser_WSAT_Policy" />
<soap:operation soapAction="RegisterUser" />
<input>
<wsp:PolicyReference URI="#SecurityWebServicePortBinding_RegisterUser_WSAT_Policy" />
<soap:body use="literal" />
</input>
<output>
<wsp:PolicyReference URI="#SecurityWebServicePortBinding_RegisterUser_WSAT_Policy" />
<soap:body use="literal" />
</output>
<fault name="UsernameExistsException">
<soap:fault name="UsernameExistsException" use="literal" />
</fault>
</operation>
</binding>
...
</definitions>
If I remove all the policy elements from the WSDL, Visual Studio is able to consume the service without any problems (in fact earlier I used to write the WSDL by hand and never put the policy statements). So my questions are:
Why is GlassFish insisting on adding the policies? Is there any way to suppress them?
Why is Visual Studio not able to consume the WSDL with the policies?
ws-AT (Atomic Transactions) seems to be part of the SOAP specification which WCF does not know about.
There is some information here - http://schemas.xmlsoap.org/ws/2004/10/wsat/
Update: Actually WCF is aware of the ws-AT spec, but doesn't support it fully (http://schemas.xmlsoap.org/ws/2004/10/wsat/). I suppose this is because WCF has alternatives which use OleTransactions.
Ok, I figured out why GlassFish is adding the ws-AT policies. My web service is being generated using an EJB (see below):
#Stateless
#WebService
public class SecurityWebService {
...
}
Since the default transaction attribute for a stateless EJB method is REQUIRED, GlassFish is making the web service method transactional too (see here for details). Not the behavior I want, but that's how it is!