Salesforce Soap API on VB .NET: Attribute cannot be applied multiple times - vb.net

I'm using Visual Studio 2019 to make a VB .NET to make a WPF application for windows. I'm trying to use the Salesforce SOAP api to grab data from it. In the solution explorer I right click on my project -> Add -> Service Reference -> advanced -> add web reference. I put in the link to the enterprise WSDL file I downloaded from Salesforce. In my project I have a simple test button setup that runs this to try and login:
Dim SFService = New SFAPI.SforceService
Dim loginResult = New SFAPI.LoginResult
loginResult = SFService.login(userID, userPass)
My issue is that I get some errors stating that the autogenerated References.vb has errors and they are as follows:
Error BC30663 Attribute 'GeneratedCodeAttribute' cannot be applied multiple times.
Error BC30663 Attribute 'SerializableAttribute' cannot be applied multiple times.
Error BC30663 Attribute 'DebuggerStepThroughAttribute' cannot be applied multiple times.
Error BC30663 Attribute 'DesignerCategoryAttribute' cannot be applied multiple times.
Error BC30663 Attribute 'XmlTypeAttribute' cannot be applied multiple times.
Warning Custom tool warning: Schema could not be validated. Class generation may fail or may produce incorrect results
Warning Custom tool warning: Schema validation error: Schema item 'simpleType' named 'FaultCode' from namespace 'urn:fault.enterprise.soap.sforce.com' is invalid. The Enumeration constraining facet is invalid - 'fns' is an undeclared prefix.
Warning Custom tool warning: Schema validation error: Schema item 'simpleType' named 'FaultCode' from namespace 'urn:fault.enterprise.soap.sforce.com' is invalid. The Enumeration constraining facet is invalid - 'fns' is an undeclared prefix.
Any help would be greatly appreciated. Thank you!!

In cases where you get errors related to an attribute being applied twice, this usually means that there is a duplicate vb file somewhere. Best thing to do is to hit the icon in your solution explorer to show all files: . There's probably a file being hidden/causing a duplicate here.
Ultimately, there's duplicate attributes being seen by the compiler, which is a failure, unless you specifically allow duplicate attributes.

Related

What does Oracle-apex SyntaxError : unexpected token means?

So I'm using the Apex office print (AOP) plugin for printing the reports from Oracle Apex. After I created a process which prints the document by clicking the button, there is an error:
"Error: SyntaxError: Unexpected token % in JSON at position 0".
Does anybody know what is the problem?
It's usually a hint that some JSON is malformed
You should consider the information presented by the AOP team on this particular error, and compare that with your situation.
https://www.apexofficeprint.com/docs/index.html#1012-syntaxerror-unexpected-token-p-in-json-at-position-0
If you are using APEX 5.1 or above, the Dynamic Action plug-in will always work, whereas the Process plug-in might give this JSON error.
The AOP process in the Processing part will only work if the “Reload on Submit” attribute (of the page) is set to “Always”. Since APEX 5.1 and above that attribute is set to “Only for Success” and then the process plug-in is not working.
Alternative you can put the AOP Process to be After Header, and make it conditional than it will work regardless of the setting of "Reload on Submit".
We recommend using the AOP dynamic action.

Is there out of the box Agile process templates to upload in TFS 2015

I am trying to configure planning tools to use the Backlog and Board features in TFS 2015. I am getting 7 warnings and 2 errors when I try to configure features and click the Verify button. Years ago a developer was playing with the work item types but none of the work the developer did is valid. It's preventing me from configuring features. Here is the list of warning and errors when trying to configure features.
[Warning]TF400609: Cannot add the action
'Microsoft.VSTS.Actions.StartWork' to the work item type 'Task'
because the state 'New' does not exist.
[Warning] TF400609: Cannot add the action
'Microsoft.VSTS.Actions.StopWork' to the work item type 'Task' because
the state 'New' does not exist.
[Warning] TF400609: Cannot add the action
'Microsoft.VSTS.Actions.StartWork' to the work item type 'Bug' because
the state 'New' does not exist.
[Warning] TF400609: Cannot add the action
'Microsoft.VSTS.Actions.StopWork' to the work item type 'Bug' because
the state 'New' does not exist.
[Warning] VS402404: Bugs On TaskBoard: Bug does not have the
Microsoft.VSTS.Common.Activity field defined. Some charts will not
include these work item types.
[Warning] VS402404: Bugs On TaskBoard: Bug does not have the
Microsoft.VSTS.Scheduling.RemainingWork field defined. Some charts
will not include these work item types.
[Warning] TF400607: Category 'Microsoft.HiddenCategory' will be
overwritten.
[Error] TF400654: Unable to configure Planning Tools. The following
element contains an error: RequirementBacklog/Columns. TF400529: This
element defines the columns that appear on the backlog. You must set
all values to fields that exist in at least one of the work item types
belonging to the category. The following fields do not exist in any
of the work item types: Microsoft.VSTS.Common.ValueArea.
[Error] TF400654: Unable to configure Planning Tools. The following
element contains an error: BugWorkItems/BugWorkItems. TF400506:This
element defines the states for work items that represent Bugs or
Defects. Each state must exist in at least one of the work item types
that are defined in: BugWorkItems. The following states do not exist
in any of the work item types: New.
I am wondering if I can upload the "out of the box" agile process
templates for TFS 2015.
On a side note, when I download the Agile Process Template using the Process Template Manager in Visual Studio 2013 and then immediately
try to upload the same templates (without any changes) I get the following error:
Exception Message: TF237070: Importing the definition failed. The
definition you are trying to import did not validate against the
schema. Edit the definition, then try toimport it again.
So I am not even sure I will be able to upload the "out of the box" agile process templates.
Thanks in advance for any insight into my issue.
First, to manage the process template. You should need to open the same version of Visual Studio or Team Explorer as the on-premises TFS that you connect to. For example, if you connect to a TFS 2015 instance, you must connect from Visual Studio 2015 or Team Explorer 2015.
According to the error info TF400654, this error is mentioned in MSDN link Resolve errors received when configuring features, please try the related resolution:
Export process configuration using witadmin
exportprocessconfig.
Change the States elements and add the missing field or state to match your work items states.
Then export categories and all categories matches your workflow
requirements.
Finally import them after changes.

LGHT0309 : Failed to open merge module for validation

What means the follow error message? I receive it after I add the "Languages" attribute to "Package" tag with an list of IDs like described in http://www.geektieguy.com/2010/03/13/create-a-multi-lingual-multi-language-msi-using-wix-and-custom-build-scripts/
light.exe : error LGHT0309 : Failed to open merge module for
validation. The most common cause of this error is specifying that the
merge module supports multiple languages (using the Package/#Languages
attribute) but not including language-specific embedded transforms. To
fix this error, make the merge module language-neutral, make it
language-specific, embed language transforms as specified in the MSI
SDK at http://msdn.microsoft.com/library/aa367799.aspx, or disable
validation.
It seems to be wrong to set the Languages via the *.wix file with the current WIX version. You need to:
create the msi file
add (embedded) the translations
set the language IDs in the msi file
A good description can you find here: https://www.hass.de/content/how-create-msi-packages-multilingual-user-interface-mui
The error is self explanatory.
In your source file for the merge module, what value do you have for the Module/Package#Languages attribute?
The error also suggests that you can fix this by making the Languages attribute to 0.
Hope this helps.

<global namespace> contains definition for __ in multiple code generated files

I just can't get a handle on how to correct this one. It cropped up about a week ago, and I don't know what change I made could have caused this. We use SVN and I rolled back changes I made of possible culprits of these errors but I am still getting the following errors when I build my asp.net webforms project:
The namespace <global namespace> already contains a definition for 'TrxStatus'
The namespace <global namespace> already contains a definition for 'MessageStatusType'
These two errors are repeated 5 times (10 errors total) and the source files are code generated for the loads of webservices we have in the project.
The file names are App_Code.34kjg234jh1.cs (made up, but you get the idea) and at the top of each one it tells me where it is being generated from:
App_Code\App_WebReferences\SomeService\SomeWebService.wsdl
If I go into the .wsdl definition I believe they do all live in the same namespace based off of this line: (Note, I am not a .wsdl wiz, so tell me if I am wrong)
<s:schema elementFormDefault="qualified" targetNamespace="http://www.thirdpartysite.com/Soa/Foundation/">
<s:import namespace="http://www.thirdpartysite.com/Soa/Foundation/MessageDefinition.xsd" />
This is an application inherited from our prior developer (its a one developer shop here, so I usually get to poke around in the dark) so I don't know why we have about 7 different web services in the application, all with that namespace definition and ALL with the offending 'TrxStatus' and 'MessageStatusType'.
I don't want to change the namespaces, because it is the right namespace (I believe), but I also need this conflict to go away. I am not sure which direction to go.
I attempted to go into one of the .wsdl files and change TrxStatus to TrxStatus_Whatever but that gave me this error:
Unable to import binding 'MyWebServiceName' from namespace http://www.thirdpartysite.com/SOA/Foundation
Another possible clue is I am getting a ton warnings from the various web services that say something like this:
The 'http://www.thirdpartysite.com/Soa/Foundation/MessageDefinition.xsd:SomeElementName' element is not declared.
Any suggestions on possible solutions to this? What is the root cause? Please don't tell me I need to re-write all these services....
I'm by no measure an expert, in fact I do very little ASP.NET & Services.
BUT. It sounds as if there are conflicting imports (i.e usings) that are pulling in types with the same names.
proj1: A.SomeType
proj2: A.SomeType
You can add references to both projects and it play just fine (I believe). But the difficulty comes when you import both namespaces because the type names clash.
You can access the correct type by using the global:: accessor.
You can even use global:: in a using statement.
using A = global::[path to correct project and type here]
Not sure if it'll be much use to you, but there's more info on global:: here:
http://msdn.microsoft.com/en-us/library/c3ay4x3d.aspx

can i use a generic list in a WCF called from silverlight?

when i return a generic List of my custom object in a wcf service, silverlight gives me this error when i update my service reference (and the reference.cs file is completely blank)
ugly ones like this:
Warning 18 Custom tool warning: Cannot import wsdl:binding
Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on.
XPath to wsdl:portType: //wsdl:definitions[#targetNamespace='']/wsdl:portType[#name='Service1']
XPath to Error Source: //wsdl:definitions[#targetNamespace='http://tempuri.org/']/wsdl:binding[#name='CustomBinding_Service1'] C:\Silverlight\POCFinRap\FinRapSilverlightPoc\FinRapSilverlightPoc\Service References\ServiceReference2\Reference.svcmap 1 1 FinRapSilverlightPoc
When i change the return type to a string, all goes fine. (also when i return a List<string> it gives me the errors)
edit 1: by the way: it's SL4
edit 2: i have a silverlight project and a webproject (default created by vs2010) and the SVC is in the webproject.
After a LOT of trial and error and a post which i clicked away accidentily so i can't give him/her credits:
The 'reuse types in referenced assemblies' checkbox gave me the troubles.