<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>{ Duane.Wingett } - JDeveloper</title>
    <link>http://www.duanewingett.info/</link>
    <description>.Net Code Monkey</description>
    <language>en-gb</language>
    <copyright>Duane Wingett</copyright>
    <lastBuildDate>Mon, 31 Mar 2008 14:07:10 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>mail@duanewingett.info</managingEditor>
    <webMaster>mail@duanewingett.info</webMaster>
    <item>
      <trackback:ping>http://www.duanewingett.info/Trackback.aspx?guid=728e6c3c-172c-4292-9d99-3e53560fb6d8</trackback:ping>
      <pingback:server>http://www.duanewingett.info/pingback.aspx</pingback:server>
      <pingback:target>http://www.duanewingett.info/PermaLink,guid,728e6c3c-172c-4292-9d99-3e53560fb6d8.aspx</pingback:target>
      <dc:creator>Duane Wingett</dc:creator>
      <wfw:comment>http://www.duanewingett.info/CommentView,guid,728e6c3c-172c-4292-9d99-3e53560fb6d8.aspx</wfw:comment>
      <wfw:commentRss>http://www.duanewingett.info/SyndicationService.asmx/GetEntryCommentsRss?guid=728e6c3c-172c-4292-9d99-3e53560fb6d8</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
As part of the preliminary research and design process for a prospective
new project at work one of the requirements will be for the application to provide
a webservice that can be consumed from a third party's Java application.
</p>
        <p>
So without further ado a quick .Net webservice was nocked up in C# with a single WebMethod.
The WebMethod would return a formatted string containing within it the value
passed in as a string parameter. The Webservice was deployed to localhost and tested
using the simple webform test that is present on a local instal.
</p>
        <p>
All good so far.
</p>
        <p>
Next is to build a small Java web project that can consume the webservice. So having
never written a Java application before, it's a quick trip to see Mr Google for a
working example of how to call a webservice from Java. ( <a href="http://www.duanewingett.info/2008/03/31/MyFirstJavaApp.aspx">See
My First Java App</a> ) Google thankfully turned up <a href="http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=257552">David
Hobbs</a>' example "<span class="ArticleTopTitle" id="ctl00_ArticleTopHeader_ArticleTitle"><a href="http://www.codeproject.com/KB/XML/WSfromJava.aspx">How
to consume an ASP.NET webservice from Java via SOAP</a>"</span> on CodeProject. After
a an hour or after nocking up a quick Java webpage with an embedded applet
that will call the webservice and display the result, it should be a case of running
it and seeing it work like clockwork.... After all the whole idea of a webservice
is to platform unspecific, isn't it?....
</p>
        <p>
Well, I shouldn't really have expected miracles, should I? After a whole afternoon
of checking and double checking that the code was correct and using a free trial of <a href="http://www.prestosoft.com/edp_examdiffpro.asp">ExamDiff
Pro</a> to ensure that XML that the java code was out putting was exactly what
the XML that the server was expecting to receive I came to the conclusion that it
must be something perculiar to our network. The XML output was identical except for
the physical value of the parameter.
</p>
        <p>
So at the end of the day I was at a loss. I'm not sure if it is an error in the code,
or if the webservice expects different XML than what the description page offers up.
Or if there is a network security issue which isn't allowing communication between
the two applications. One of my .Net Windows applications calls a .Net webservice
which is built in the same way as this test one perfectly, and has done for the last
year! Event the third party representative was at a bit of a loss.
</p>
        <p>
So I am at a bit of a loss with this one. May be a fresh look in a new week will shed
some light. Who knows? If any one else has come accross this issue, and resolved or
not resolved it, please post and let me know your findings!
</p>
        <p>
          <hr />
        </p>
        <p>
        </p>
        <p>
          <font size="1">
            <strong>Postscript: #1</strong>
            <br />
          </font>I have just noticed on the botttom of David's CodeProject artical the following:
</p>
        <p>
          <em>
            <font color="#808080">
              <strong>Notes</strong>
              <br />
Some Java Virtual Machines (like the Microsoft one) only allow you to make a socket
connection to the same machine that hosts the Java class files. Therefore, if you're
using an applet like me, you will need to host the Java class files on the same machine
where the webservice resides.</font>
          </em>
        </p>
        <p>
I wonder if this has anything to do with the problem... Oh well, maybe tomorrow I'll
waste another fruitless afternoon trying to find out!! ;-)
</p>
        <p>
          <font size="1">
            <strong>Postscript: #2</strong>
          </font>
          <br />
Well after further investigation I haven't managed to determin the fault, but today
we tried a different approach and used the "Web Service proxy" object from the <strong>Business
Tier</strong> &gt; <strong>Web Services</strong> category in the New Gallery.
</p>
        <p>
          <img src="http://www.duanewingett.info/content/binary/NewGalleryWebService.jpg" border="0" />
        </p>
        <p>
We then followed the wizard and let it generate the code. The outputted code was tested
and hey presto!!
</p>
        <p>
So I guess this topic is closed for me now!
</p>
        <img width="0" height="0" src="http://www.duanewingett.info/aggbug.ashx?id=728e6c3c-172c-4292-9d99-3e53560fb6d8" />
      </body>
      <title>"Invalid Parameter" error when attempting to consume a .Net WebService from a Java application over network.</title>
      <guid isPermaLink="false">http://www.duanewingett.info/PermaLink,guid,728e6c3c-172c-4292-9d99-3e53560fb6d8.aspx</guid>
      <link>http://www.duanewingett.info/2008/03/31/InvalidParameterErrorWhenAttemptingToConsumeANetWebServiceFromAJavaApplicationOverNetwork.aspx</link>
      <pubDate>Mon, 31 Mar 2008 14:07:10 GMT</pubDate>
      <description>&lt;p&gt;
As part of the&amp;nbsp;preliminary research&amp;nbsp;and design process for a prospective
new project at work one of the requirements will be for the application to provide
a webservice that can be consumed from a third party's&amp;nbsp;Java application.
&lt;/p&gt;
&lt;p&gt;
So without further ado a quick .Net webservice was nocked up in C# with a single WebMethod.
The WebMethod would return a&amp;nbsp;formatted string&amp;nbsp;containing within it the value
passed in as a string parameter. The Webservice was deployed to localhost and tested
using the simple webform test that is present on a local instal.
&lt;/p&gt;
&lt;p&gt;
All good so far.
&lt;/p&gt;
&lt;p&gt;
Next is to build a small Java web project that can consume the webservice. So having
never written a Java application before, it's a quick trip to see Mr Google for a
working example of how to call a webservice from Java. ( &lt;a href="http://www.duanewingett.info/2008/03/31/MyFirstJavaApp.aspx"&gt;See
My First Java App&lt;/a&gt; ) Google thankfully turned up &lt;a href="http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=257552"&gt;David
Hobbs&lt;/a&gt;' example "&lt;span class=ArticleTopTitle id=ctl00_ArticleTopHeader_ArticleTitle&gt;&lt;a href="http://www.codeproject.com/KB/XML/WSfromJava.aspx"&gt;How
to consume an ASP.NET webservice from Java via SOAP&lt;/a&gt;"&lt;/span&gt; on CodeProject. After
a&amp;nbsp;an hour or after nocking up a quick Java webpage&amp;nbsp;with an embedded applet
that will call the webservice and display the result, it should be a case of running
it and seeing it work like clockwork....&amp;nbsp;After all the whole idea of a webservice
is to platform unspecific, isn't it?....
&lt;/p&gt;
&lt;p&gt;
Well, I shouldn't really have expected miracles, should I? After a whole afternoon
of checking and double checking that the code was correct and using a free trial of &lt;a href="http://www.prestosoft.com/edp_examdiffpro.asp"&gt;ExamDiff
Pro&lt;/a&gt; to ensure that XML that&amp;nbsp;the java code was out putting was exactly what
the XML that the server was expecting to receive I came to the conclusion that it
must be something perculiar to our network. The XML output was identical except for
the physical value of the parameter.
&lt;/p&gt;
&lt;p&gt;
So at the end of the day I was at a loss. I'm not sure if it is an error in the code,
or if the webservice expects different XML than what the description page offers up.
Or if there is a network security issue which isn't allowing communication between
the two applications. One of my .Net Windows applications calls a .Net webservice
which is built in the same way as this test one perfectly, and has done for the last
year! Event the third party representative was at a bit of a loss.
&lt;/p&gt;
&lt;p&gt;
So I am at a bit of a loss with this one. May be a fresh look in a new week will shed
some light. Who knows? If any one else has come accross this issue, and resolved or
not resolved it, please post and let me know your findings!
&lt;/p&gt;
&lt;p&gt;
&lt;hr&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font size=1&gt;&lt;strong&gt;Postscript: #1&lt;/strong&gt;
&lt;br&gt;
&lt;/font&gt;I have just noticed on the botttom of David's CodeProject artical the following:
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;font color=#808080&gt;&lt;strong&gt;Notes&lt;/strong&gt;
&lt;br&gt;
Some Java Virtual Machines (like the Microsoft one) only allow you to make a socket
connection to the same machine that hosts the Java class files. Therefore, if you're
using an applet like me, you will need to host the Java class files on the same machine
where the webservice resides.&lt;/font&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
I wonder if this has anything to do with the problem... Oh well, maybe tomorrow I'll
waste another fruitless afternoon trying to find out!! ;-)
&lt;/p&gt;
&lt;p&gt;
&lt;font size=1&gt;&lt;strong&gt;Postscript: #2&lt;/strong&gt;&lt;/font&gt;
&lt;br&gt;
Well after further investigation I haven't managed to determin the fault, but today
we tried a different approach and used the "Web Service proxy" object from the &lt;strong&gt;Business
Tier&lt;/strong&gt; &amp;gt; &lt;strong&gt;Web Services&lt;/strong&gt; category&amp;nbsp;in the New Gallery.
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.duanewingett.info/content/binary/NewGalleryWebService.jpg" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
We then followed the wizard and let it generate the code. The outputted code was tested
and hey presto!!
&lt;/p&gt;
&lt;p&gt;
So I guess this topic is closed for me now!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.duanewingett.info/aggbug.ashx?id=728e6c3c-172c-4292-9d99-3e53560fb6d8" /&gt;</description>
      <comments>http://www.duanewingett.info/CommentView,guid,728e6c3c-172c-4292-9d99-3e53560fb6d8.aspx</comments>
      <category>.Net</category>
      <category>Java</category>
      <category>SOAP</category>
      <category>Web Services</category>
      <category>XML</category>
      <category>JDeveloper</category>
    </item>
  </channel>
</rss>