Consuming WCF service in Java does not generate an interface -
we have pretty big wcf service use quite time, until we've been connecting via c#. have need connect java. found out if use eclipse , go new/other/web service client can put wsdl link there auto generate code. doing straight away did not produce though. obtained 2 files, 1 of had empty body. first issue auto generation tool - creates something, don't see log of succeeded , failed in creating. searched , found out had change bindings basichttpbinding, , make sure httpgetenabled
set "true
". after change, auto generation in java produces lot of code, data contract schemas , on. , 4 files under 'org.tempuri
' namespace:
basichttpbinding_imyservicestub.java imyserviceproxy.java myservice.java myservicelocator.java
however looking @ tutorials, seems should fifth one, imyservice.java
- did not get. and, have errors in generated code pointing out indeed imyservice cannot resolved, being used in few places, definition not auto-generated. since have no logs of has failed during auto generation, i'm kind of lost culprit. have experience on either:
a) locating logs auto generation tell me went wrong
b) directly know causes interface class not generated?
i'm suspecting have change more in webconfig file on server. second guess perhaps use c# construct not recognised java...or something. anyway, completly lost here, there no feedback of went wrong.
here webconfig file iis server.
<?xml version="1.0"?> <configuration> <connectionstrings> <add name="xxx" connectionstring="xxx" providername="system.data.sqlclient"/> </connectionstrings> <system.web> <compilation targetframework="4.0"/> <customerrors mode="off"/> <httpruntime executiontimeout="5400" requestvalidationmode="2.0"/> <identity impersonate="false"/> </system.web> <system.servicemodel> <bindings> <custombinding> <binding name="bindingnettcp" closetimeout="01:00:00" opentimeout="01:00:00" receivetimeout="01:00:00" sendtimeout="01:00:00"> <binarymessageencoding maxsessionsize="2147483647"> <readerquotas maxdepth="2147483647" maxstringcontentlength="2147483647" maxarraylength="2147483647" maxbytesperread="2147483647" maxnametablecharcount="2147483647"/> </binarymessageencoding> <tcptransport maxbufferpoolsize="2147483647" maxreceivedmessagesize="2147483647" maxbuffersize="2147483647"/> </binding> <binding name="bindinghttps" closetimeout="01:00:00" opentimeout="01:00:00" receivetimeout="01:00:00" sendtimeout="01:00:00"> <binarymessageencoding maxreadpoolsize="2147483647" maxwritepoolsize="2147483647" maxsessionsize="2147483647"> <readerquotas maxdepth="2147483647" maxstringcontentlength="2147483647" maxarraylength="2147483647" maxbytesperread="2147483647" maxnametablecharcount="2147483647"/> </binarymessageencoding> <httpstransport manualaddressing="false" maxbufferpoolsize="2147483647" maxreceivedmessagesize="2147483647" allowcookies="true" authenticationscheme="anonymous" bypassproxyonlocal="false" hostnamecomparisonmode="strongwildcard" keepaliveenabled="true" maxbuffersize="2147483647" proxyauthenticationscheme="anonymous" realm="" transfermode="streamedresponse" unsafeconnectionntlmauthentication="false" usedefaultwebproxy="true"/> </binding> <binding name="bindinghttp" closetimeout="01:00:00" opentimeout="01:00:00" receivetimeout="01:00:00" sendtimeout="01:00:00"> <binarymessageencoding maxreadpoolsize="2147483647" maxwritepoolsize="2147483647" maxsessionsize="2147483647"> <readerquotas maxdepth="2147483647" maxstringcontentlength="2147483647" maxarraylength="2147483647" maxbytesperread="2147483647" maxnametablecharcount="2147483647"/> </binarymessageencoding> <httptransport manualaddressing="false" maxbufferpoolsize="2147483647" maxreceivedmessagesize="2147483647" allowcookies="true" authenticationscheme="anonymous" bypassproxyonlocal="false" hostnamecomparisonmode="strongwildcard" keepaliveenabled="true" maxbuffersize="2147483647" proxyauthenticationscheme="anonymous" realm="" transfermode="streamedresponse" unsafeconnectionntlmauthentication="false" usedefaultwebproxy="true"/> </binding> </custombinding> <nettcpbinding> <binding name="nettcpbinding_igodservice" closetimeout="00:01:00" opentimeout="00:01:00" receivetimeout="00:10:00" sendtimeout="00:01:00" transactionflow="false" transfermode="buffered" transactionprotocol="oletransactions" hostnamecomparisonmode="strongwildcard" listenbacklog="10" maxbufferpoolsize="524288" maxbuffersize="65536" maxconnections="10" maxreceivedmessagesize="65536"> <readerquotas maxdepth="32" maxstringcontentlength="8192" maxarraylength="16384" maxbytesperread="4096" maxnametablecharcount="16384"/> <reliablesession ordered="true" inactivitytimeout="00:10:00" enabled="false"/> <security mode="transport"> <transport clientcredentialtype="certificate" protectionlevel="encryptandsign"/> <message clientcredentialtype="windows"/> </security> </binding> <binding name="nettcpbinding_igodservice1" closetimeout="00:01:00" opentimeout="00:01:00" receivetimeout="00:10:00" sendtimeout="00:01:00" transactionflow="false" transfermode="buffered" transactionprotocol="oletransactions" hostnamecomparisonmode="strongwildcard" listenbacklog="10" maxbufferpoolsize="524288" maxbuffersize="65536" maxconnections="10" maxreceivedmessagesize="65536"> <readerquotas maxdepth="32" maxstringcontentlength="8192" maxarraylength="16384" maxbytesperread="4096" maxnametablecharcount="16384"/> <reliablesession ordered="true" inactivitytimeout="00:10:00" enabled="false"/> <security mode="transport"> <transport clientcredentialtype="certificate" protectionlevel="encryptandsign"/> <message clientcredentialtype="windows"/> </security> </binding> <binding name="custombinding_idqmserver"> <security mode="none"/> </binding> </nettcpbinding> </bindings> <services> <service name="xxx.xxx" behaviorconfiguration="xxxbehavior"> <host> <baseaddresses> <add baseaddress="net.tcp://example.com:4502/xxx/xxx/"/> <add baseaddress="http://example.com/xxx/xxx/"/> </baseaddresses> </host> <endpoint address="mex" binding="mexhttpbinding" contract="imetadataexchange"/> <endpoint address="" binding="custombinding" bindingconfiguration="bindinghttps" contract="xxx.ixxx"/> <endpoint address="" binding="basichttpbinding" contract="xxx.ixxx"/> <endpoint address="" binding="custombinding" bindingconfiguration="bindingnettcp" contract="xxx.ixxx"/> </service> </services> <behaviors> <servicebehaviors> <behavior name="xxxbehavior"> <datacontractserializer maxitemsinobjectgraph="2147483647"/> <servicethrottling maxconcurrentcalls="2500" maxconcurrentinstances="2147483647" maxconcurrentsessions="2147483647"/> <servicemetadata httpgetenabled="true" httpsgetenabled="true"/> <servicedebug includeexceptiondetailinfaults="true"/> </behavior> </servicebehaviors> <endpointbehaviors> <behavior name="srvbehavior"> <clientcredentials> <clientcertificate findvalue="xxx" storelocation="localmachine" storename="my" x509findtype="findbysubjectname"/> <servicecertificate> <authentication certificatevalidationmode="peertrust"/> </servicecertificate> </clientcredentials> </behavior> </endpointbehaviors> </behaviors> <servicehostingenvironment multiplesitebindingsenabled="true"/> </system.servicemodel> <system.webserver> <modules runallmanagedmodulesforallrequests="true"/> <defaultdocument> <files> <add value="xxx.svc"/> </files> </defaultdocument> </system.webserver> </configuration>
please note im using basichttpbinding there, "bindinghttp" https one, didnt work @ all.
edit: pointed out in comment section, we're using lists in service quite lot, example of c# wcf interface:
public class listresults<t>//our own custom return class { public list<t> result { get; set; } public long? id { get; set; } public int? error { get; set; } } [securityoperationbehavior] [operationcontract] listresults<somedatatype> somelistfunction(string param1, long? param2, bool? param3);
Comments
Post a Comment