SOAP error in visual studio 2005 - visual-studio

I am trying to add a SOAP service using VS 2005 via add web reference. However when I add the reference, I get all options disabled and the following error. What am I doing wrong?
The document at the url http://interface.postcodechecker.co.uk/wsdl/pccInterface.wsdl was not recognized as a known document type.
The error message from each known type may help you fix the problem:
Report from 'DISCO Document' is 'Discovery document at the URL http://interface.postcodechecker.co.uk/wsdl/pccInterface.wsdl could not be found.'.
The document format is not recognized (the content type is 'application/wsdl+xml').
Report from 'WSDL Document' is 'There is an error in XML document (73, 30).'.
Namespace prefix 'soapenc' is not defined.
Report from 'XML Schema' is 'The root element of a W3C XML Schema should be and its namespace should be 'http://www.w3.org/2001/XMLSchema'.'.

Looks to me like they fumbled the schema. Save the .wsdl to a file and open it in a text editor. Add two lines to the header so it looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="Postcodes"
targetNamespace="http://interface.postcodechecker.co.uk/wsdl/pccSOAP.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://interface.postcodechecker.co.uk/wsdl/pccSOAP.wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<types>
etc...
The two added lines are indented, note that the angle bracket was moved. Then just load the service reference from the file.

Related

Extending Visual Studio 2017 XML editor

I'm trying to improve our workflow with some XML-configuration files we use in a Visual Studio Solution. I figured I'll start with explaining what I'm trying to accomplish and then explain some of my ideas that I've tried for several hours without success.
The Problem
I'm working with a system where the data model is configured in a database, the models are also stored on disk using xml-files, these are then synced during startup of the app. Here's part of the stuff that are synced:
Data Types
All data types lives in one XML configuration file per data type and each has some properties like Name and Key. All data types are configured in the same folder, example: /config/dataTypes
Example
textString.config
<?xml version="1.0" encoding="UTF-8" ?>
<DataType Key="a45c9a94-09d7-4df9-85e6-d6930abc6c12" Name="Textstring">
textArea.config
<?xml version="1.0" encoding="UTF-8" ?>
<DataType Key="b104788f-4e2f-4592-9387-8b3861bd8046" Name="Textarea">
Entity Types
Think of these as models with X number of properties, each property is configured and connected to a Data Type.
Example
customer.config
<?xml version="1.0" encoding="UTF-8" ?>
<Entity>
<Properties>
<Property Name="Firstname" TypeKey="a45c9a94-09d7-4df9-85e6-d6930abc6c12" />
<Property Name="Lastname" TypeKey="a45c9a94-09d7-4df9-85e6-d6930abc6c12" />
<Property Name="Description" TypeKey="b104788f-4e2f-4592-9387-8b3861bd8046" />
</Properties>
</Entity>
My end goal is to provide intellisense when editing a Entity Type so that I'll get all the Data Types as suggestions when entering the "TypeKey" property of the Property element. Preferably showing the Name of the data type in the dropdown list and when choosing it adding the guid as value for the TypeKey-property. I would also like to show the Data Types name when hovering the GUID with the mouse (or in some other way).
As you can imagen during the process with a project new data types can be added so the intellisense needs to be dynamic based on the files in the data types-folder.
I should also mention that these configuration files also can be edited from a UI in the application and I don't have control over how they are serialized, hence - there is no XML namespace in the files, they look like in the examples above.
We also have multiple different VS-solutions with different setups of Data Types and Entity Types. So we need individual intellisense in each project.
What I've tried
My first idea was to create a VS-extension that creates a dynamic XML Schema XSD-file based on the files in the data types folder. The VS would then pick up and use the XSD for XML-files in the Project, turns out that this only works with a namespace configured (remember, I can't add namespaces since I don't control the external app).
To get around this it worked to manually add the schema-file to the XML file while editing the file. (Like this: https://learn.microsoft.com/en-us/visualstudio/xml-tools/how-to-select-the-xml-schemas-to-use?view=vs-2019). The problem with this is that it needs to be done for each xml-file and the setting is not stored.
I then started to play with the VS extension possibilities to try to automatically configure this Schema to a XML-file that is opened. Turns out I had a really hard time to get the "configuration object" that is pushed to the Properties Browser when the XML file is opened. I managed to get a event-handler setup that was triggered when the XML files as getting "focus" but I was stucked trying getting the properties from the Properties Browser.
I also tried another approach with a custom "code completion"-extension but it made the UI feel very "cluttered" while editing.
After spending about 10 hours playing around with this I feel I don't really have a good path to a solution as my experience with VS-extensions is not that extensive.
I would love to get some feedback and ideas on how to approach this problem, since the XSD is different from each project if I go down the "dynamic" path we can't use the global VS settings since each project has different data types hence needs different allowed values for the TypeKey property.
One approach that I'm thinking about is to use a generic XSD (allowing all values for the TypeKey) in the Global Schema Cache for Visual Studio and create a "code completion"-feature for just the TypeKeys.
Any thoughts and pointers in the right direction would be very much appreciated.

Extract account ID from Oracle SOA response in SoapUI

We have an Oracle SOA gateway setup that we can pass SOAP requests to. Right now, I'm trying to use SoapUI to create test cases. In this particular one, I'm trying to create a customer account. I've got the skeleton setup, but I'm having issues setting the correct XPath up to extract the account ID from the SOAP response.
The response I get back from the SOA gateway is:
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header/>
<env:Body>
<OutputParameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.oracle.com/apps/hz/soaprovider/plsql/hz_cust_account_v2pub/create_cust_account__1/">
<X_CUST_ACCOUNT_ID>1459660</X_CUST_ACCOUNT_ID>
<X_ACCOUNT_NUMBER>58946</X_ACCOUNT_NUMBER>
<X_PARTY_ID>3101110</X_PARTY_ID>
<X_PARTY_NUMBER>215767</X_PARTY_NUMBER>
<X_PROFILE_ID>3322847</X_PROFILE_ID>
<X_RETURN_STATUS>S</X_RETURN_STATUS>
<X_MSG_COUNT>0</X_MSG_COUNT>
<X_MSG_DATA xsi:nil="true"/>
</OutputParameters>
</env:Body>
</env:Envelope>
From this, I'm trying to extract the returned X_CUST_ACCOUNT_ID, and put it into a property. The XPath that I'm using is
//OutputParameters/X_CUST_ACCOUNT_ID
However, doing so, all I get is an error stating
"Missing match for Source XPath [//OutputParameters/X_CUST_ACCOUNT_ID]"
I've spent hours trying various XPath expressions, and all I get are either missing match or syntax errors.
You were missing the fact that OutputParameters also has a default namespace defined by
xmlns="http://xmlns.oracle.com/apps/hz/soaprovider/plsql/hz_cust_account_v2pub/create_cust_account__1/"
To also ignore this namespace, you can use the following expression:
//*[local-name()='OutputParameters']/*[local-name()='X_CUST_ACCOUNT_ID']

Debug KML: Namespace prefix xsi for schemaLocation on Document is not defined

I would like to submit the KML file generated by ArcGIS 10.1 and GoogleEarthPRO (GE) as supplementary data for my paper in Elsevier.
However, the reviewer wrote me back: "here is an error in the prefix "xsi" for attribute "xsi:schemaLocation”.
When I tried the simple validation of KML file by adding .xml extension and dropping to Chrome (following: http://kml4earth.appspot.com/kmlBestPractice.html) , I've got an error:
error on line 3 at column 217: Namespace prefix xsi for schemaLocation
on Document is not defined
I generated the KML by ArcGIS 10.1 (shp to KML, tool: Layer To KML), which produced the zipped .kmz file. I opened the .kmz file in GoogleEarthPRO and again saved my place as .kml file. Apparenly, the .kml file works well as I can open the file in GE and share it between PC.
I also tried the KMLvalidator here: http://www.kmlvalidator.org/validate.htm with error:
File upload request was rejected. (/data/tomcat/base-kml-validator/temp/upload_2a88fa18_1591832a38f__7fff_00001631.tmp (No such file or directory)).
I don't understand why my .kml file seems to work fine in GoogleEarthPRO on multiple PCs, but it apparently contains the error in xsi for schemaLocation?
The most important, what is the easiest way to fix it?
I am not familiar with scripting the KML code, I am just a beginner and user of GE. Please, how can easily fix my schemaLocation?
File to download: https://www.dropbox.com/s/azmc6m1ksvtau7o/high_tatra_mts.kml?dl=0
Thank you !
Google Earth generally ignores namespaces and XML elements it doesn't know about so a KML file that is an invalid XML file may still be viewable in Google Earth. To enable error checking in Google Earth, open Tools/Options/General and check the "Show prompts for all errors" option then open your KML file.
If there is a namespace error in your KML file then you need to declare it in KML file - typically in the root element.
Here is the structure of a valid KML file:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
...
</kml>
Note that Google Earth will not fix invalid namespace references in your KML so these must be fixed in a text editor and validated externally to Google Earth.
In your particular example, the xsi declaration and schemaLocation attributes are unnecessary so your KML can be simplified to this:
<kml xmlns="http://www.opengis.net/kml/2.2">
..
</kml>

ListInstance deployment guid problems

I have a very basic setup, currently, and I'm fairly new to Sharepoint. I followed the walkthrough here to create a Field definition, content type, list definition from the content type, and a list instance from that list definition.
Currently, if I attempt to deploy my feature with everything in it, I get the following error:
Error occurred in deployment step 'Activate Features': Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
The feature doesn't show up in the administration panel, but the list instance is created (but has no fields because the custom content type isn't activated).
If I remove the listinstance from the feature, everything else activates just fine, and if I put the listinstance in a separate feature it still works, but this really all needs to be in one feature and I don't understand why it doesn't work that way. I added a guid to the list instance that was auto generated because I need to reference this list in the rest of the feature's code. This is the list instance's Elements.xml file:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ListInstance Title="SurveyModule - SurveyList"
Id="{C0ED4B73-B140-4057-989B-43344CEE921E}"
OnQuickLaunch="TRUE"
TemplateType="10000"
Url="Lists/SurveyModule-SurveyList"
Description="My List Instance">
</ListInstance>
</Elements>
If there are any other code snippets which would be relevant I can post them.
try it without the braces in the id attribute
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ListInstance Title="SurveyModule - SurveyList"
Id="C0ED4B73-B140-4057-989B-43344CEE921E"
OnQuickLaunch="TRUE"
TemplateType="10000"
Url="Lists/SurveyModule-SurveyList"
Description="My List Instance">
</ListInstance>
</Elements>
if it still doesn't work, generate a new GUID using: Visual Studio - Tools - Generate GUID (Registry)

Sharepoint List added to Create -> Custom Lists on Feature deployment

I am building a SharePoint Feature to deploy a simple WebPart and a custom list within the "Web" scope.
When the solution is deployed my list is immediately available in Site Actions -> Site Settings -> Custom Lists.
If you try and create an instance of the list I receive "File Not Found"
If you activate the feature a second copy of the list template is added to the Custom Lists heading.
Neither list can be created with the same "File Not Found" error
On deactivating the feature one list template disappears
On retracting the solution the last list template disappears
Files Involved:
schema.xml is 5000 lines long
feature.xml is as follows
<?xml version="1.0" encoding="utf-8" ?>
<Feature Id="78a8eaad-2160-434c-81c2-6c5f7ce94ade" Title="WeekWidget" Description="Displays A, B or H based upon a configurable SharePoint List." Version="1.0.0.0" Creator="Cardinal Newman Catholic School // Richard Slater" Scope="Web" ImageUrl="WeekWidget\WeekWidgetLogo.jpg" xmlns="http://schemas.microsoft.com/sharepoint/" DefaultResourceFile="core">
<ElementManifests>
<ElementManifest Location="ListTemplates\WeekCalendar.xml" />
<ElementFile Location="WeekCalendar\Schema.xml" />
</ElementManifests>
</Feature>
WeekCalendar.xml is as follows
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ListTemplate Name="WeekCalendar" DisplayName="Week Calendar" Description="List of Weeks." BaseType="0" Type="100" OnQuickLaunch="TRUE" SecurityBits="11" Sequence="410" Image="/_layouts/images/itgen.gif" />
</Elements>
I think the "File Not Found" error is symptomatic of another problem, however the addition of the list template shouldn't happen on solution deployment. What am I doing wrong?
are you wiring up all of the feature files yourself or using a tool? typically, the 404 means one of the 'magic strings' in your configuration files is off. Also, the directory structure specified here looks suspicious:
<ElementManifests>
<ElementManifest Location="ListTemplates\WeekCalendar.xml" />
<ElementFile Location="WeekCalendar\Schema.xml" />
</ElementManifests>
You should try deploying all of your feature support files to the same directory. Have you located the error in the ULS log (<12 hive>/LOGS)? That may provide some clues too.
I think the problem could be related to the separate directory structure--I usually deploy all list files to the same folder (schema.xml and weekcalendar.xml, in your case; keep feature.xml out of the list directory).
Turn on verbose logging and check the 12-hive logs to see what file is not found.
Check schema.xml and ensure the name attribute on the list element matches the name of the folder housing your feature. Also watch out for the Url attribute on this element... VSeWSS will set the URL to the name of the list being reverse engineered so I change it to "pages\viewpage.axp".
On the default view element within schema.xml, try adding SetupPath="pages\viewpage.aspx". Ensure there's a WebPartZoneId="Main" attribute on there as well.

Resources