im pretty new in programming WCF Service Applications using C#. Currently im learning and what i was trying now is create a web service application class from WSDL. First of all i created a WSDL which is looking like the WSDL at the end of the post. Now i want to use the Tool "svcUtil" in order to create my class. In the command prompt i tried to write
C:\program files (x86)\Microsoft sdks\windows\v7.0a\bin>svcutil /language:csharp "c:\users\myNick\Documents\visual studio 2010\projects\myWSDL.wsdl"
and was expecting a class file to be written in the project folder. But i always got the following error message:
"Warning: No code was generated.
If you were trying to generate a client, this could be because the metadata documents did not contain any valid contracts or services
or because all contracts/services were discovered to exist in /reference assemblies. Verify that you passed all the metadata documents to the tool.
Waring: if you would like to generate data contracts form schemas make sure to use the /datacontractonly option."
I was searching in internet for some help but wasn't able to figure out what is going wrong. Is anything is missing in my WSDL? From what i know everything should be there or am i wrong?
Thanks for help!
best regards
Marbuel
<definitions>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://MyCompany.com/MyService/wsdl/abstract" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:complexType name="Request">
<xs:sequence>
<xs:element name="Value" type="xs:string">
<xs:annotation>
<xs:documentation>
Include here either string with XML escaped
characters or in CDATA section
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="FaultMessage">
<xs:sequence>
<xs:element name="Value" type="xs:string">
<xs:annotation>
<xs:documentation>
Include here either string with XML escaped
characters or in CDATA section
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>
<types>
data type definitions........
</types>
<message>
<part name="FaultMessage" type="FaultMessage"></part>
</message>
<message name="RequestMessage">
<part name="request" type="Request"/>
</message>
<portType name="MyInterface">
<operation name="sendData">
<input message="RequestMessage"></input>
<fault name="fault1" message="FaultMessage"/>
</operation>
</portType>
<binding xmlns:soap="http://www.w3.org/2001/XMLSchema" type="MyInterface" name="b1">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<operation>
<soap:operation soapAction="http://example.com/sendData"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
</definitions>
Related
Using a client/server Infinispan implementation, the write operations use Protobuf serialization, but the load operation is using the java serializer. How can I configure the load to use the Protobuf serialization?
Here is the server and cache config:
<cache-container name="default" statistics="true">
<transport cluster="${infinispan.cluster.name:cluster}" stack="${infinispan.cluster.stack:tcp}" node-name="${infinispan.node.name:}"/>
<security>
<authorization/>
</security>
</cache-container>
<cache-container name="operationnproto" statistics="true">
<serialization>
<context-initializer class="com.bskyb.infinispan.datastores.BookSchemaImpl"/>
</serialization>
<distributed-cache name="distributedCache-operationnproto" owners="2" capacity-factor="1">
<encoding media-type="application/x-protostream"/>
<persistence>
<store class="com.bskyb.infinispan.datastores.BookCacheStore">
<property name="lbCassandraCluster"></property>
<property name="lbCassandraPort"></property>
<property name="lbCassandraDatacenter">datacenter1</property>
</store>
</persistence>
</distributed-cache>
I followed the link ESB as a JMS Producer to configure the sender and receiver. I have also placed the following jars activemq-broker-5.8.0.jar activemq-client-5.8.0.jar activemq-kahadb-store-5.8.0.jar
geronimo-jms_1.1_spec-1.1.1.jar geronimo-j2ee-management_1.1_spec-1.0.1.jar geronimo-jta_1.0.1B_spec-1.0.1.jar hawtbuf-1.9.jar Slf4j-api-1.6.6.jar activeio-core-3.1.4.jar into WSO2_EI_HOME/lib
When I configured a proxy with the following code and tried to send the messages to the queue, but the messages aren't delivering.
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="Sender"
startOnLoad="true"
statistics="disable"
trace="disable"
transports="http,https">
<target>
<inSequence>
<property name="OUT_ONLY" value="true"/>
<send>
<endpoint>
<address uri="jms:/VALLYSOFTQ?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616&transport.jms.DestinationType=queue"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
<description/>
</proxy>
The same configuration worked earlier for me but I don't know what happened, the messages are not going to the queue now.
Thanks in advance.
How do I get inbound the SOAP payload converted to a HTTP Post payload so that it can be sent via my HTTPEndpoint
An example would be greatly appreciated
You can set the endpoint format to pox to create a plain xml message to be posted. See for example: http://charithaka.blogspot.nl/2010/07/message-format-transformations-with.html
Are you referring to SOAP to REST conversion? In that case it would be like following.
<proxy xmlns="http://ws.apache.org/ns/synapse" name="testProxy" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<property name="messageType" value="application/xml" scope="axis2"/>
<send>
<endpoint>
<http method="POST" uri-template="http://localhost:9000"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
<description/>
</proxy>
The axis2 messageType property decides the MessageFormatter used to format the message before sending out. In this case its application/xml so the Content-Type of the outgoing POST request will be application/xml.
Is there an API for WSO2 API Manager that I can consume? As in say, get a list of the API's or whatever. I heard there is a SOAP API for this, but I cannot find anything about it. I'm hoping someone has got some information. I found this XML file (listed below) that may or may not be what I need but I'm a total noob when it comes to SOAP and don't know of this what I need. Here's the file contents. Is this what a WSDL file would look like?
<?xml version="1.0" encoding="UTF-8"?><serviceGroup name="API" successfullyAdded="true">
<service name="API" exposedAllTransports="true" serviceDeployedTime="1347567758279" successfullyAdded="true">
<operation name="getAPI">
<parameter name="AuthorizationAction">/permission/admin/manage/resources/govern/apis/list</parameter>
<module name="addressing" version="4.0" type="engagedModules"/>
<module name="relay" version="4.0" type="engagedModules"/>
</operation>
<operation name="updateAPI">
<parameter name="AuthorizationAction">/permission/admin/manage/resources/govern/apis/add</parameter>
<module name="addressing" version="4.0" type="engagedModules"/>
<module name="relay" version="4.0" type="engagedModules"/>
</operation>
<operation name="getAPIDependencies">
<parameter name="AuthorizationAction">/permission/admin/manage/resources/govern/apis/list</parameter>
<module name="addressing" version="4.0" type="engagedModules"/>
<module name="relay" version="4.0" type="engagedModules"/>
</operation>
<operation name="addAPI">
<parameter name="AuthorizationAction">/permission/admin/manage/resources/govern/apis/add</parameter>
<module name="addressing" version="4.0" type="engagedModules"/>
<module name="relay" version="4.0" type="engagedModules"/>
</operation>
<operation name="getAPIArtifactIDs">
<parameter name="AuthorizationAction">/permission/admin/manage/resources/govern/apis/list</parameter>
<module name="addressing" version="4.0" type="engagedModules"/>
<module name="relay" version="4.0" type="engagedModules"/>
</operation>
<operation name="deleteAPI">
<parameter name="AuthorizationAction">/permission/admin/manage/resources/govern/apis/add</parameter>
<module name="addressing" version="4.0" type="engagedModules"/>
<module name="relay" version="4.0" type="engagedModules"/>
</operation>
<bindings>
<binding name="APISoap12Binding">
<operation name="getAPI"/>
<operation name="updateAPI"/>
<operation name="getAPIDependencies"/>
<operation name="addAPI"/>
<operation name="deleteAPI"/>
<operation name="getAPIArtifactIDs"/>
</binding>
<binding name="APIHttpBinding">
<operation name="getAPI"/>
<operation name="updateAPI"/>
<operation name="getAPIDependencies"/>
<operation name="addAPI"/>
<operation name="deleteAPI"/>
<operation name="getAPIArtifactIDs"/>
</binding>
<binding name="APISoap11Binding">
<operation name="getAPI"/>
<operation name="updateAPI"/>
<operation name="getAPIDependencies"/>
<operation name="addAPI"/>
<operation name="deleteAPI"/>
<operation name="getAPIArtifactIDs"/>
</binding>
</bindings>
<policies/>
<module name="addressing" version="4.0" type="engagedModules"/>
<module name="relay" version="4.0" type="engagedModules"/>
<parameter name="enableMTOM">true</parameter>
<parameter name="adminService">true</parameter>
<parameter name="AuthorizationAction">/permission/admin/login</parameter>
<parameter name="hiddenService">true</parameter>
</service>
</serviceGroup>
Yes,there's a javascript API layer built with Jaggery which can be used to consume API Manager related functionalities in a REST way.
Currently,you can find them inside the two jaggery applications [store/publisher] with following location.Navigate to it,and you'll notice there are several sub-directories inside 'blocks' directory according to the terms that api manager related functionalities catogorized [eg:item-add,listing,search,etc].Open the reuired catogory and there will be a sub folder called 'ajax' since we are passing requests in AJAX way.Inside that you can find the jag file which contains the relevant API methods that can be consume in a REST way.
Yet we have not separate this API layer from the web-application flow to make a user easy to find and consume the API,but we are planning to add this API layer separate in to the apps in near future.
For the moment,what you can do is just go to the above mentioned location,and find the relevant API method to consume.Say for an example if you want to consume addAPI method in api-publisher,what you can do is navigate to 'ajax' sub-directory of'item-add' directory in the location .You'll see there's a file called 'add.jag'.Open it and identify what is the action[eg:addAPI] and what are the request parameters[eg:APIName,version,etc] you need to pass to process the action.Then send http request to the API function by using a REST client.[eg:CURL].For example here your http request will be following way.
"http://ip:port/publisher/site/blocks/item-add/ajax/add.jag -d "action=addAPI&name=API1&version=1.0.0&description=API&endpoint=http://search.twitter.com&wsdl=&tags=open,social&tier=Silver&thumbUrl=https://lh6.ggpht.com/RNc8dD2hXG_rWGzlj09ZwAe1sXVvLWkeYT3ePx7zePCy4ZVV2XMGIxAzup4cKM85NFtL=w124&context=/api2&tiersCollection=Gold&resourceCount=0&resourceMethod-0=POST&uriTemplate-0=/*";"
You can find three samples[TwitterSearch,YahooPlaceFinder,YoutubeFinds] written based on this JavaScript layer from the below location of your downloaded pack.
{API Manager HOME}/samples
Navigate to each three above samples inside the above location and have a look on APIPopulator.sh script,to get better understanding how the API Manager related jaggery API has been consumed from those.
Adding to above,for WSO2 API Manager implementation of its back-end major functionalities we have not used web-service invocations but a java API which can be found from here.You can use that API to do your custom implementations.You can find our java[back-end] implementation from this java API from here.
I've been trying to find out which version of SOAP 1.1/1.2 being using in WSDL generated using WCF BasicHTTPBinding. But I've not been able to pin-point.
I need to confirm this so that I can tell me clients that we are using specific version of SOAP. The requirement is to use SOAP 1.1. From what I read BasicHttpBinding uses SOAP1.1 but not being able to find or check.
Could someone please help.
e.g.
<wsdl:definitions name="MyService" targetNamespace="http://mydomain.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:tns="http://spotless.com/isb/services" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
In your WSDL definition WCF includes namespaces for both SOAP 1.1. and SOAP 1.2. Namespace for SOAP 1.1 has prefix soap. SOAP 1.1 endpoint will use only this namespace:
<wsdl:binding name="SomeBinding" type="...">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="GetTime">
<soap:operation soapAction="..." style="..." />
<wsdl:input name="...">
<soap:body use="..." />
</wsdl:input>
<wsdl:output name="...">
<soap:body use="..." />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="...">
<wsdl:port name="..." binding="tns:SomeBinding">
<soap:address location="..." />
</wsdl:port>
</wsdl:port>
Do you see all these elements prefixed by soap? That means SOAP 1.1 because soap prefix is defined for SOAP 1.1 namespace. If it uses soap12 prefix instead it will mean SOAP 1.2.
If WCF service has multiple endpoints it will have multiple wsdl:port elements and each can refer to its ownwsdl:binding specification with different version of SOAP and different policies (I skipped policy references in the example).
BasicHttpBinding in WCF always uses SOAP 1.1.